PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ RTreeCacheClear()

static void RTreeCacheClear ( RTREE_POLY_CACHE cache)
static

Free the cache object and all the sub-objects properly.

Definition at line 76 of file lwgeom_rtree.c.

77 {
78  int g, r, i;
79  POSTGIS_DEBUGF(2, "RTreeCacheClear called for %p", cache);
80  i = 0;
81  for (g = 0; g < cache->polyCount; g++)
82  {
83  for (r = 0; r < cache->ringCounts[g]; r++)
84  {
85  RTreeFree(cache->ringIndices[i]);
86  i++;
87  }
88  }
89  lwfree(cache->ringIndices);
90  lwfree(cache->ringCounts);
91  cache->ringIndices = 0;
92  cache->ringCounts = 0;
93  cache->polyCount = 0;
94 }
char * r
Definition: cu_in_wkt.c:24
void lwfree(void *mem)
Definition: lwutil.c:244
static void RTreeFree(RTREE_NODE *root)
Recursively frees the child nodes, the interval and the line before freeing the root node.
Definition: lwgeom_rtree.c:56
RTREE_NODE ** ringIndices
Definition: lwgeom_rtree.h:60

References lwfree(), RTREE_POLY_CACHE::polyCount, r, RTREE_POLY_CACHE::ringCounts, RTREE_POLY_CACHE::ringIndices, and RTreeFree().

Referenced by RTreeFreer().

Here is the call graph for this function:
Here is the caller graph for this function: