PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ RTreeFreer()

static int RTreeFreer ( GeomCache *  cache)
static

Callback function sent into the GetGeomCache generic caching system.

On a cache miss, this function clears the cached index object.

Definition at line 398 of file lwgeom_rtree.c.

399 {
400  RTreeGeomCache* rtree_cache = (RTreeGeomCache*)cache;
401 
402  if ( ! cache )
403  return LW_FAILURE;
404 
405  if ( rtree_cache->index )
406  {
407  RTreeCacheClear(rtree_cache->index);
408  lwfree(rtree_cache->index);
409  rtree_cache->index = 0;
410  rtree_cache->gcache.argnum = 0;
411  }
412  return LW_SUCCESS;
413 }
#define LW_FAILURE
Definition: liblwgeom.h:79
#define LW_SUCCESS
Definition: liblwgeom.h:80
void lwfree(void *mem)
Definition: lwutil.c:244
static void RTreeCacheClear(RTREE_POLY_CACHE *cache)
Free the cache object and all the sub-objects properly.
Definition: lwgeom_rtree.c:76
GeomCache gcache
Definition: lwgeom_rtree.h:68
RTREE_POLY_CACHE * index
Definition: lwgeom_rtree.h:69

References RTreeGeomCache::gcache, RTreeGeomCache::index, LW_FAILURE, LW_SUCCESS, lwfree(), and RTreeCacheClear().

Here is the call graph for this function: