PostGIS  3.3.9dev-r@@SVN_REVISION@@

◆ ShpDumperDestroy()

void ShpDumperDestroy ( SHPDUMPERSTATE state)

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

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

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: