PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ ShpDumperDestroy()

void ShpDumperDestroy ( SHPDUMPERSTATE state)

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

2224 {
2225  /* Destroy a state object created with ShpDumperConnect */
2226  int i;
2227 
2228  if (state != NULL)
2229  {
2230  /* Disconnect from the database */
2231  if (state->conn)
2232  PQfinish(state->conn);
2233 
2234  /* Free the query strings */
2235  if (state->fetch_query)
2236  free(state->fetch_query);
2237  if (state->main_scan_query)
2238  free(state->main_scan_query);
2239 
2240  /* Free the DBF information fields */
2241  if (state->dbffieldnames)
2242  {
2243  for (i = 0; i < state->fieldcount; i++)
2244  free(state->dbffieldnames[i]);
2245  free(state->dbffieldnames);
2246  }
2247 
2248  if (state->dbffieldtypes)
2249  free(state->dbffieldtypes);
2250 
2251  if (state->pgfieldnames)
2252  free(state->pgfieldnames);
2253 
2254  /* Free any column map fieldnames if specified */
2255  colmap_clean(&state->column_map);
2256 
2257  /* Free other names */
2258  if (state->table)
2259  free(state->table);
2260  if (state->schema)
2261  free(state->schema);
2262  if (state->geo_col_name)
2263  free(state->geo_col_name);
2264 
2265  /* Free the state itself */
2266  free(state);
2267  }
2268 }
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: