PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ PreparedCacheDelete()

static void PreparedCacheDelete ( void *  ptr)
static

Definition at line 103 of file lwgeom_geos_prepared.c.

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

Referenced by PrepGeomCacheBuilder().

104 {
105  MemoryContext context = (MemoryContext)ptr;
106 #endif
107 
108  PrepGeomHashEntry* pghe;
109 
110  /* Lookup the hash entry pointer in the global hash table so we can free it */
111  pghe = GetPrepGeomHashEntry(context);
112 
113  if (!pghe)
114  elog(ERROR, "PreparedCacheDelete: Trying to delete non-existant hash entry object with MemoryContext key (%p)", (void *)context);
115 
116  POSTGIS_DEBUGF(3, "deleting geom object (%p) and prepared geom object (%p) with MemoryContext key (%p)", pghe->geom, pghe->prepared_geom, context);
117 
118  /* Free them */
119  if ( pghe->prepared_geom )
120  GEOSPreparedGeom_destroy( pghe->prepared_geom );
121  if ( pghe->geom )
122  GEOSGeom_destroy( (GEOSGeometry *)pghe->geom );
123 
124  /* Remove the hash entry as it is no longer needed */
125  DeletePrepGeomHashEntry(context);
126 }
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:
Here is the caller graph for this function: