diff --git a/modules/flann/include/opencv2/flann/hierarchical_clustering_index.h b/modules/flann/include/opencv2/flann/hierarchical_clustering_index.h index c068e184bb..78ac401630 100644 --- a/modules/flann/include/opencv2/flann/hierarchical_clustering_index.h +++ b/modules/flann/include/opencv2/flann/hierarchical_clustering_index.h @@ -404,34 +404,16 @@ public: */ virtual ~HierarchicalClusteringIndex() { - free_elements(); - if (root!=NULL) { delete[] root; } if (indices!=NULL) { + free_indices(); delete[] indices; } } - - /** - * Release the inner elements of indices[] - */ - void free_elements() - { - if (indices!=NULL) { - for(int i=0; i