PostGIS  2.5.0beta1dev-r@@SVN_REVISION@@

◆ ShpDumperDestroy()

void ShpDumperDestroy ( SHPDUMPERSTATE state)

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

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