[geos-commits] [SCM] GEOS branch main-relate-ng updated. f6fc2e2261ba86c71a90d71e08175b204e22955a

git at osgeo.org git at osgeo.org
Fri Aug 9 11:38:59 PDT 2024


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, main-relate-ng has been updated
       via  f6fc2e2261ba86c71a90d71e08175b204e22955a (commit)
      from  af08e708e9176abd6b1462fac158d24dc19a6cff (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f6fc2e2261ba86c71a90d71e08175b204e22955a
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Aug 9 11:38:38 2024 -0700

    Close small memory leak on exception

diff --git a/src/operation/relateng/TopologyComputer.cpp b/src/operation/relateng/TopologyComputer.cpp
index 1ac9c56b3..984073e46 100644
--- a/src/operation/relateng/TopologyComputer.cpp
+++ b/src/operation/relateng/TopologyComputer.cpp
@@ -233,11 +233,16 @@ TopologyComputer::getNodeSections(const CoordinateXY& nodePt)
 void
 TopologyComputer::addIntersection(NodeSection* a, NodeSection* b)
 {
+    // add edges to node to allow full topology evaluation later
+    // we run this first (unlike JTS) in case the subsequent test throws
+    // an exception and the NodeSection pointers are not correctly
+    // saved in the memory managed store on the NodeSections, causing
+    // a small memeory leak
+    addNodeSections(a, b);
+
     if (! a->isSameGeometry(b)) {
         updateIntersectionAB(a, b);
     }
-    //-- add edges to node to allow full topology evaluation later
-    addNodeSections(a, b);
 }
 
 

-----------------------------------------------------------------------

Summary of changes:
 src/operation/relateng/TopologyComputer.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list