branch:
details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/f977fcbbca30
changeset: 1521:f977fcbbca30
user: tmodes <tm...@us...>
date: Mon Sep 23 18:12:52 2019 +0200
description:
Fixes memory leak in graphcut algorithm
Patch by Lukas
diffstat:
VERSION | 2 +-
src/graphcut.h | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
diffs (42 lines):
diff -r 803e2cb3da0f -r f977fcbbca30 VERSION
--- a/VERSION Wed Aug 07 12:30:21 2019 +0200
+++ b/VERSION Mon Sep 23 18:12:52 2019 +0200
@@ -1,1 +1,1 @@
-4.3-f53c2b56e4c5
+4.3-803e2cb3da0f
diff -r 803e2cb3da0f -r f977fcbbca30 src/graphcut.h
--- a/src/graphcut.h Wed Aug 07 12:30:21 2019 +0200
+++ b/src/graphcut.h Mon Sep 23 18:12:52 2019 +0200
@@ -1340,7 +1340,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 +1459,7 @@
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 +1470,7 @@
totalDualPath.push_back(*j);
}
}
+ delete dualPath;
vigra::copyImage(srcImageRange(graphImg), destImage(intermediateGraphImg));
intermediatePoint = *i;
@@ -1481,7 +1481,6 @@
dest_upperleft, da, totalDualPath, iBB);
delete intermediatePointList;
- delete dualPath;
}
} /* namespace enblend */
|