PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ ShpDumperDestroy()

void ShpDumperDestroy ( SHPDUMPERSTATE state)

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

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