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

Definition at line 2188 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().

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

Here is the call graph for this function:

Here is the caller graph for this function: