PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ ShpDumperDestroy()

void ShpDumperDestroy ( SHPDUMPERSTATE state)

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

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

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: