PostGIS  2.2.8dev-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 62 of file lwgeom_rtree.c.

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

Referenced by RTreeFreer().

63 {
64  int g, r, i;
65  POSTGIS_DEBUGF(2, "RTreeCacheClear called for %p", cache);
66  i = 0;
67  for (g = 0; g < cache->polyCount; g++)
68  {
69  for (r = 0; r < cache->ringCounts[g]; r++)
70  {
71  RTreeFree(cache->ringIndices[i]);
72  i++;
73  }
74  }
75  lwfree(cache->ringIndices);
76  lwfree(cache->ringCounts);
77  cache->ringIndices = 0;
78  cache->ringCounts = 0;
79  cache->polyCount = 0;
80 }
char * r
Definition: cu_in_wkt.c:24
void lwfree(void *mem)
Definition: lwutil.c:214
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:42
RTREE_NODE ** ringIndices
Definition: lwgeom_rtree.h:35
Here is the call graph for this function:
Here is the caller graph for this function: