[geos-commits] [SCM] GEOS branch master updated. b5133ae3b0dc166c2b53b951a19c63f5a58d6044

git at osgeo.org git at osgeo.org
Mon Apr 15 08:28:19 PDT 2019


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, master has been updated
       via  b5133ae3b0dc166c2b53b951a19c63f5a58d6044 (commit)
      from  0d1aaa6e8f1732d57b4f810d2bddd3de9f150f47 (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 b5133ae3b0dc166c2b53b951a19c63f5a58d6044
Author: Daniel Baston <dbaston at gmail.com>
Date:   Mon Apr 15 11:27:47 2019 -0400

    Fix memory leak in GeometryGraph
    
    SegmentIntersector was leaked when an exception was thrown during
    calculation of edge intersections.

diff --git a/src/geomgraph/GeometryGraph.cpp b/src/geomgraph/GeometryGraph.cpp
index 2bf95f6..c816520 100644
--- a/src/geomgraph/GeometryGraph.cpp
+++ b/src/geomgraph/GeometryGraph.cpp
@@ -409,7 +409,7 @@ GeometryGraph::computeEdgeIntersections(GeometryGraph* g,
 #if GEOS_DEBUG
     cerr << "GeometryGraph::computeEdgeIntersections call" << endl;
 #endif
-    SegmentIntersector* si = new SegmentIntersector(li, includeProper, true);
+    unique_ptr<SegmentIntersector> si(new SegmentIntersector(li, includeProper, true));
 
     si->setBoundaryNodes(getBoundaryNodes(), g->getBoundaryNodes());
     unique_ptr<EdgeSetIntersector> esi(createEdgeSetIntersector());
@@ -431,11 +431,11 @@ GeometryGraph::computeEdgeIntersections(GeometryGraph* g,
         //cerr << "Other edges reduced from " << oe->size() << " to " << other_edges_copy.size() << endl;
         oe = &other_edges_copy;
     }
-    esi->computeIntersections(se, oe, si);
+    esi->computeIntersections(se, oe, si.get());
 #if GEOS_DEBUG
     cerr << "GeometryGraph::computeEdgeIntersections returns" << endl;
 #endif
-    return si;
+    return si.release();
 }
 
 void

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

Summary of changes:
 src/geomgraph/GeometryGraph.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list