PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ ShpLoaderDestroy()

void ShpLoaderDestroy ( SHPLOADERSTATE state)

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

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

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 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: