PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ ShpDumperDestroy()

void ShpDumperDestroy ( SHPDUMPERSTATE state)

Definition at line 2203 of file pgsql2shp-core.c.

2204 {
2205  /* Destroy a state object created with ShpDumperConnect */
2206  int i;
2207 
2208  if (state != NULL)
2209  {
2210  /* Disconnect from the database */
2211  if (state->conn)
2212  PQfinish(state->conn);
2213 
2214  /* Free the query strings */
2215  if (state->fetch_query)
2216  free(state->fetch_query);
2217  if (state->main_scan_query)
2218  free(state->main_scan_query);
2219 
2220  /* Free the DBF information fields */
2221  if (state->dbffieldnames)
2222  {
2223  for (i = 0; i < state->fieldcount; i++)
2224  free(state->dbffieldnames[i]);
2225  free(state->dbffieldnames);
2226  }
2227 
2228  if (state->dbffieldtypes)
2229  free(state->dbffieldtypes);
2230 
2231  if (state->pgfieldnames)
2232  free(state->pgfieldnames);
2233 
2234  /* Free any column map fieldnames if specified */
2235  colmap_clean(&state->column_map);
2236 
2237  /* Free other names */
2238  if (state->table)
2239  free(state->table);
2240  if (state->schema)
2241  free(state->schema);
2242  if (state->geo_col_name)
2243  free(state->geo_col_name);
2244 
2245  /* Free the state itself */
2246  free(state);
2247  }
2248 }
void free(void *)
void colmap_clean(colmap *map)
Definition: shpcommon.c:167

References colmap_clean(), shp_dumper_state::column_map, shp_dumper_state::conn, shp_dumper_state::dbffieldnames, shp_dumper_state::dbffieldtypes, shp_dumper_state::fetch_query, shp_dumper_state::fieldcount, free(), shp_dumper_state::geo_col_name, shp_dumper_state::main_scan_query, shp_dumper_state::pgfieldnames, shp_dumper_state::schema, and shp_dumper_state::table.

Referenced by main(), pgui_action_export(), and test_ShpDumperDestroy().

Here is the call graph for this function:
Here is the caller graph for this function: