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

◆ ShpLoaderDestroy()

void ShpLoaderDestroy ( SHPLOADERSTATE state)

Definition at line 1952 of file shp2pgsql-core.c.

1953{
1954 /* Destroy a state object created with ShpLoaderOpenShape */
1955 int i;
1956 if (state != NULL)
1957 {
1958 if (state->hSHPHandle)
1959 SHPClose(state->hSHPHandle);
1960 if (state->hDBFHandle)
1961 DBFClose(state->hDBFHandle);
1962 if (state->field_names)
1963 {
1964 for (i = 0; i < state->num_fields; i++)
1965 free(state->field_names[i]);
1966
1967 free(state->field_names);
1968 }
1969 if (state->pgfieldtypes)
1970 {
1971 for (i = 0; i < state->num_fields; i++)
1972 free(state->pgfieldtypes[i]);
1973
1974 free(state->pgfieldtypes);
1975 }
1976 if (state->types)
1977 free(state->types);
1978 if (state->widths)
1979 free(state->widths);
1980 if (state->precisions)
1981 free(state->precisions);
1982 if (state->col_names)
1983 free(state->col_names);
1984
1985 /* Free any column map fieldnames if specified */
1986 colmap_clean(&state->column_map);
1987
1988 /* Free the state itself */
1989 free(state);
1990 }
1991}
void SHPAPI_CALL DBFClose(DBFHandle psDBF)
Definition dbfopen.c:599
void free(void *)
void SHPAPI_CALL SHPClose(SHPHandle hSHP)
Definition shpopen.c:879
void colmap_clean(colmap *map)
Definition shpcommon.c:171
DBFFieldType * types

References shp_loader_state::col_names, colmap_clean(), shp_loader_state::column_map, DBFClose(), shp_loader_state::field_names, free(), shp_loader_state::hDBFHandle, shp_loader_state::hSHPHandle, shp_loader_state::num_fields, shp_loader_state::pgfieldtypes, shp_loader_state::precisions, SHPClose(), shp_loader_state::types, and shp_loader_state::widths.

Referenced by main(), pgui_action_import(), test_ShpLoaderDestroy(), and validate_remote_loader_columns().

Here is the call graph for this function:
Here is the caller graph for this function: