PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ SHPClose()

void SHPAPI_CALL SHPClose ( SHPHandle  psSHP)

Definition at line 888 of file shpopen.c.

890 {
891  if( psSHP == SHPLIB_NULLPTR )
892  return;
893 
894 /* -------------------------------------------------------------------- */
895 /* Update the header if we have modified anything. */
896 /* -------------------------------------------------------------------- */
897  if( psSHP->bUpdated )
898  SHPWriteHeader( psSHP );
899 
900 /* -------------------------------------------------------------------- */
901 /* Free all resources, and close files. */
902 /* -------------------------------------------------------------------- */
903  free( psSHP->panRecOffset );
904  free( psSHP->panRecSize );
905 
906  if ( psSHP->fpSHX != SHPLIB_NULLPTR)
907  psSHP->sHooks.FClose( psSHP->fpSHX );
908  psSHP->sHooks.FClose( psSHP->fpSHP );
909 
910  if( psSHP->pabyRec != SHPLIB_NULLPTR )
911  {
912  free( psSHP->pabyRec );
913  }
914 
915  if( psSHP->pabyObjectBuf != SHPLIB_NULLPTR )
916  {
917  free( psSHP->pabyObjectBuf );
918  }
919  if( psSHP->psCachedObject != SHPLIB_NULLPTR )
920  {
921  free( psSHP->psCachedObject );
922  }
923 
924  free( psSHP );
925 }
void free(void *)
void SHPAPI_CALL SHPWriteHeader(SHPHandle psSHP)
Definition: shpopen.c:147
#define SHPLIB_NULLPTR
Definition: shpopen.c:101
int(* FClose)(SAFile file)
Definition: shapefil.h:296
SAFile fpSHX
Definition: shapefil.h:318
SAFile fpSHP
Definition: shapefil.h:317
SHPObject * psCachedObject
Definition: shapefil.h:340
unsigned int * panRecSize
Definition: shapefil.h:327
SAHooks sHooks
Definition: shapefil.h:315
unsigned char * pabyObjectBuf
Definition: shapefil.h:338
int bUpdated
Definition: shapefil.h:332
unsigned int * panRecOffset
Definition: shapefil.h:326
unsigned char * pabyRec
Definition: shapefil.h:334

References SHPInfo::bUpdated, SAHooks::FClose, SHPInfo::fpSHP, SHPInfo::fpSHX, free(), SHPInfo::pabyObjectBuf, SHPInfo::pabyRec, SHPInfo::panRecOffset, SHPInfo::panRecSize, SHPInfo::psCachedObject, SHPInfo::sHooks, SHPLIB_NULLPTR, and SHPWriteHeader().

Referenced by ShpDumperCloseTable(), ShpLoaderDestroy(), and SHPOpenLL().

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