PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ ShpDumperDestroy()

void ShpDumperDestroy ( SHPDUMPERSTATE state)

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

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