PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ SHPClose()

void SHPAPI_CALL SHPClose ( SHPHandle  hSHP)

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 }
void SHPAPI_CALL SHPWriteHeader(SHPHandle psSHP)
Definition: shpopen.c:339
void free(void *)
Here is the call graph for this function:
Here is the caller graph for this function: