Skip to content

v0.2.49..v0.2.50 changeset BufferedLineSegmentIntersectorTest.cpp

Garret Voltz edited this page Nov 6, 2019 · 1 revision
diff --git a/hoot-core-test/src/test/cpp/hoot/core/algorithms/BufferedLineSegmentIntersectorTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/algorithms/BufferedLineSegmentIntersectorTest.cpp
index cb2d596..47fac08 100644
--- a/hoot-core-test/src/test/cpp/hoot/core/algorithms/BufferedLineSegmentIntersectorTest.cpp
+++ b/hoot-core-test/src/test/cpp/hoot/core/algorithms/BufferedLineSegmentIntersectorTest.cpp
@@ -89,8 +89,11 @@ public:
     {
       LineString* ls = dynamic_cast<LineString*>(i.get());
       assert(ls->getNumPoints() == 2);
-      result.p0 = *ls->getPointN(0)->getCoordinate();
-      result.p1 = *ls->getPointN(1)->getCoordinate();
+      //  getPointN creates a new Point object that needs to be deleted
+      std::shared_ptr<Point> p0(ls->getPointN(0));
+      std::shared_ptr<Point> p1(ls->getPointN(1));
+      result.p0 = *p0->getCoordinate();
+      result.p1 = *p1->getCoordinate();
     }
     else
     {
Clone this wiki locally