PostGIS  2.1.10dev-r@@SVN_REVISION@@
void ShpLoaderDestroy ( SHPLOADERSTATE state)

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

References shp_loader_state::col_names, DBFClose(), shp_loader_state::field_names, 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().

1846 {
1847  /* Destroy a state object created with ShpLoaderOpenShape */
1848  int i;
1849 
1850  if (state != NULL)
1851  {
1852  if (state->hSHPHandle)
1853  SHPClose(state->hSHPHandle);
1854  if (state->hDBFHandle)
1855  DBFClose(state->hDBFHandle);
1856  if (state->field_names)
1857  {
1858  for (i = 0; i < state->num_fields; i++)
1859  free(state->field_names[i]);
1860 
1861  free(state->field_names);
1862  }
1863  if (state->pgfieldtypes)
1864  {
1865  for (i = 0; i < state->num_fields; i++)
1866  free(state->pgfieldtypes[i]);
1867 
1868  free(state->pgfieldtypes);
1869  }
1870  if (state->types)
1871  free(state->types);
1872  if (state->widths)
1873  free(state->widths);
1874  if (state->precisions)
1875  free(state->precisions);
1876  if (state->col_names)
1877  free(state->col_names);
1878 
1879  /* Free the state itself */
1880  free(state);
1881  }
1882 }
DBFFieldType * types
DBFHandle hDBFHandle
SHPHandle hSHPHandle
void SHPAPI_CALL DBFClose(DBFHandle psDBF)
Definition: dbfopen.c:579
void SHPAPI_CALL SHPClose(SHPHandle hSHP)
Definition: shpopen.c:760

Here is the call graph for this function:

Here is the caller graph for this function: