PostGIS  2.3.7dev-r@@SVN_REVISION@@
void ShpDumperDestroy ( SHPDUMPERSTATE state)

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

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().

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

Here is the call graph for this function:

Here is the caller graph for this function: