PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ PreparedCacheDelete()

static void PreparedCacheDelete ( MemoryContext  context)
static

Definition at line 139 of file lwgeom_geos_prepared.c.

References DeletePrepGeomHashEntry(), PrepGeomHashEntry::geom, GetPrepGeomHashEntry(), and PrepGeomHashEntry::prepared_geom.

140 {
141  PrepGeomHashEntry* pghe;
142 
143  /* Lookup the hash entry pointer in the global hash table so we can free it */
144  pghe = GetPrepGeomHashEntry(context);
145 
146  if (!pghe)
147  elog(ERROR, "PreparedCacheDelete: Trying to delete non-existant hash entry object with MemoryContext key (%p)", (void *)context);
148 
149  POSTGIS_DEBUGF(3, "deleting geom object (%p) and prepared geom object (%p) with MemoryContext key (%p)", pghe->geom, pghe->prepared_geom, context);
150 
151  /* Free them */
152  if ( pghe->prepared_geom )
153  GEOSPreparedGeom_destroy( pghe->prepared_geom );
154  if ( pghe->geom )
155  GEOSGeom_destroy( (GEOSGeometry *)pghe->geom );
156 
157  /* Remove the hash entry as it is no longer needed */
158  DeletePrepGeomHashEntry(context);
159 }
static void DeletePrepGeomHashEntry(MemoryContext mcxt)
const GEOSPreparedGeometry * prepared_geom
const GEOSGeometry * geom
static PrepGeomHashEntry * GetPrepGeomHashEntry(MemoryContext mcxt)
Here is the call graph for this function: