Hi,

attached is a second patch for enblend.  It fixes a memory leak which
would occur whenever more than one seam is generated.

cheers, lukas

-- 
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
--- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to hugin-ptx+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/hugin-ptx/fb2aa9fe-0d9a-d2dd-9924-9e0a4a593d40%40lukas-wirz.de.
diff -r 803e2cb3da0f src/graphcut.h
--- a/src/graphcut.h	Wed Aug 07 12:30:21 2019 +0200
+++ b/src/graphcut.h	Mon Sep 23 12:33:18 2019 +0300
@@ -1340,7 +1319,6 @@
         IMAGETYPE<GradientPixelType> gradientY(size);
         IMAGETYPE<GraphPixelType> graphImg(size + size + vigra::Diff2D(1, 1));
 
-        std::vector<vigra::Point2D>* dualPath = nullptr;
         std::vector<vigra::Point2D> totalDualPath;
         vigra::Point2D intermediatePoint;
         CheckpointPixels srcDestPoints;
@@ -1460,7 +1438,8 @@
             std::cout << "Running graph-cut: " << intermediatePoint << ":" << *i << std::endl;
 #endif
 
-            dualPath = A_star<IMAGETYPE<GraphPixelType>, IMAGETYPE<GradientPixelType>, BasePixelType>
+            std::vector<vigra::Point2D>* dualPath =
+                A_star<IMAGETYPE<GraphPixelType>, IMAGETYPE<GradientPixelType>, BasePixelType>
                 (vigra::Point2D(-10, -10), vigra::Point2D(-20, -20), &intermediateGraphImg, &gradientX,
                  &gradientY, graphsize - vigra::Diff2D(1, 1), &srcDestPoints, &visited);
 
@@ -1471,6 +1450,7 @@
                     totalDualPath.push_back(*j);
                 }
             }
+            delete dualPath;
 
             vigra::copyImage(srcImageRange(graphImg), destImage(intermediateGraphImg));
             intermediatePoint = *i;
@@ -1481,7 +1461,6 @@
              dest_upperleft, da, totalDualPath, iBB);
 
         delete intermediatePointList;
-        delete dualPath;
     }
 } /* namespace enblend */
 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to