Merge pull request #2108 from pemmanuelviel:flannMemoryLeak

This commit is contained in:
Roman Donchenko 2014-01-13 16:26:02 +04:00 committed by OpenCV Buildbot
commit 87e0c26129

View File

@ -414,12 +414,6 @@ public:
void loadIndex(FILE* stream)
{
load_value(stream, branching_);
load_value(stream, trees_);
load_value(stream, centers_init_);
load_value(stream, leaf_size_);
load_value(stream, memoryCounter);
free_elements();
if (root!=NULL) {
@ -430,6 +424,12 @@ public:
delete[] indices;
}
load_value(stream, branching_);
load_value(stream, trees_);
load_value(stream, centers_init_);
load_value(stream, leaf_size_);
load_value(stream, memoryCounter);
indices = new int*[trees_];
root = new NodePtr[trees_];
for (int i=0; i<trees_; ++i) {