Merge pull request #524 from epfl-lts2:fix_memory_leaks_in_graphsegmentation

pull/530/head
Alexander Alekhin 9 years ago
commit cb3e51f9c6
  1. 12
      modules/ximgproc/src/graphsegmentation.cpp

@ -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--;
}
}
}
}

Loading…
Cancel
Save