PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ ShpLoaderDestroy()

void ShpLoaderDestroy ( SHPLOADERSTATE state)

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

1894 {
1895  /* Destroy a state object created with ShpLoaderOpenShape */
1896  int i;
1897  if (state != NULL)
1898  {
1899  if (state->hSHPHandle)
1900  SHPClose(state->hSHPHandle);
1901  if (state->hDBFHandle)
1902  DBFClose(state->hDBFHandle);
1903  if (state->field_names)
1904  {
1905  for (i = 0; i < state->num_fields; i++)
1906  free(state->field_names[i]);
1907 
1908  free(state->field_names);
1909  }
1910  if (state->pgfieldtypes)
1911  {
1912  for (i = 0; i < state->num_fields; i++)
1913  free(state->pgfieldtypes[i]);
1914 
1915  free(state->pgfieldtypes);
1916  }
1917  if (state->types)
1918  free(state->types);
1919  if (state->widths)
1920  free(state->widths);
1921  if (state->precisions)
1922  free(state->precisions);
1923  if (state->col_names)
1924  free(state->col_names);
1925 
1926  /* Free any column map fieldnames if specified */
1927  colmap_clean(&state->column_map);
1928 
1929  /* Free the state itself */
1930  free(state);
1931  }
1932 }
void SHPAPI_CALL DBFClose(DBFHandle psDBF)
Definition: dbfopen.c:578
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: