Commit cb3e51f9 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #524 from epfl-lts2:fix_memory_leaks_in_graphsegmentation

parents bd971fd7 530dfb79
......@@ -243,6 +243,8 @@ namespace cv {
}
}
}
free(thresholds);
}
void GraphSegmentationImpl::filterSmallAreas(Edge *edges, const int &nb_edges, PointSet *es) {
......@@ -297,6 +299,8 @@ namespace cv {
p[j] = mapped_id[point];
}
}
free(mapped_id);
}
void GraphSegmentationImpl::processImage(InputArray src, OutputArray dst) {
......@@ -328,6 +332,9 @@ namespace cv {
// Map to final output
finalMapping(es, output);
free(edges);
delete es;
}
Ptr<GraphSegmentation> createGraphSegmentation(double sigma, float k, int min_size) {
......@@ -351,6 +358,10 @@ namespace cv {
}
}
PointSet::~PointSet() {
free(mapping);
}
int PointSet::getBasePoint( int p) {
int base_p = p;
......@@ -376,6 +387,7 @@ namespace cv {
nb_elements--;
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment