]> granicus.if.org Git - postgis/commitdiff
Remove more memory leaks from P-I-P shortcut code.
authorPaul Ramsey <pramsey@cleverelephant.ca>
Thu, 25 Sep 2008 17:18:25 +0000 (17:18 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Thu, 25 Sep 2008 17:18:25 +0000 (17:18 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@3008 b70326c6-7e19-0410-871a-916f4a2858ee

lwgeom/lwgeom_rtree.c

index 81bf1afe61a0f7461ab4b4656c0e178b01dba5e6..5fe62ae964032d5e3693a0f7daef50d357bc6298 100644 (file)
@@ -204,7 +204,7 @@ void freeTree(RTREE_NODE *root)
                 freeTree(root->rightNode);
         lwfree(root->interval);
         if(root->segment)
-                lwfree(root->segment);
+                lwgeom_release((LWGEOM *)root->segment);
         lwfree(root);
 }
 
@@ -424,7 +424,7 @@ RTREE_POLY_CACHE *retrieveCache(LWPOLY *poly, uchar *serializedPoly,
                 LWDEBUG(3, "Polygon size mismatch, creating new cache.");
                 for(i = 0; i < currentCache->ringCount; i++)
                 {
-                       freeTree(currentCache->ringIndices[i]);
+                    freeTree(currentCache->ringIndices[i]);
                 }
                 lwfree(currentCache->ringIndices);
                 lwfree(currentCache->poly);
@@ -441,7 +441,7 @@ RTREE_POLY_CACHE *retrieveCache(LWPOLY *poly, uchar *serializedPoly,
 
                         for(i = 0; i < currentCache->ringCount; i++)
                         { 
-                               freeTree(currentCache->ringIndices[i]);
+                                       freeTree(currentCache->ringIndices[i]);
                         }
                         lwfree(currentCache->ringIndices);
                         lwfree(currentCache->poly);