PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ SHPClose()

void SHPAPI_CALL SHPClose ( SHPHandle  psSHP)

Definition at line 759 of file shpopen.c.

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

Referenced by ShpDumperCloseTable(), and ShpLoaderDestroy().

761 {
762  if( psSHP == NULL )
763  return;
764 
765 /* -------------------------------------------------------------------- */
766 /* Update the header if we have modified anything. */
767 /* -------------------------------------------------------------------- */
768  if( psSHP->bUpdated )
769  SHPWriteHeader( psSHP );
770 
771 /* -------------------------------------------------------------------- */
772 /* Free all resources, and close files. */
773 /* -------------------------------------------------------------------- */
774  free( psSHP->panRecOffset );
775  free( psSHP->panRecSize );
776 
777  if ( psSHP->fpSHX != NULL)
778  psSHP->sHooks.FClose( psSHP->fpSHX );
779  psSHP->sHooks.FClose( psSHP->fpSHP );
780 
781  if( psSHP->pabyRec != NULL )
782  {
783  free( psSHP->pabyRec );
784  }
785 
786  free( psSHP );
787 }
int(* FClose)(SAFile file)
Definition: shapefil.h:261
unsigned int * panRecOffset
Definition: shapefil.h:289
SAHooks sHooks
Definition: shapefil.h:278
SAFile fpSHX
Definition: shapefil.h:281
unsigned int * panRecSize
Definition: shapefil.h:290
void SHPAPI_CALL SHPWriteHeader(SHPHandle psSHP)
Definition: shpopen.c:339
void free(void *)
unsigned char * pabyRec
Definition: shapefil.h:297
int bUpdated
Definition: shapefil.h:295
SAFile fpSHP
Definition: shapefil.h:280
Here is the call graph for this function:
Here is the caller graph for this function: