[mlpack] 40/149: I suppose we should exercise at least some caution in the destructor.

Barak A. Pearlmutter barak+git at pearlmutter.net
Sat May 2 09:11:07 UTC 2015


This is an automated email from the git hooks/post-receive script.

bap pushed a commit to branch svn-trunk
in repository mlpack.

commit 384a9d08b50ea5bc9bcb948d3ef59552265657f1
Author: rcurtin <rcurtin at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date:   Sun Oct 12 21:09:02 2014 +0000

    I suppose we should exercise at least some caution in the destructor.
    
    
    git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@17248 9d5b8971-822b-0410-80eb-d18c1038ef23
---
 src/mlpack/methods/kmeans/pelleg_moore_kmeans_impl.hpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mlpack/methods/kmeans/pelleg_moore_kmeans_impl.hpp b/src/mlpack/methods/kmeans/pelleg_moore_kmeans_impl.hpp
index e7fd385..4a2bf83 100644
--- a/src/mlpack/methods/kmeans/pelleg_moore_kmeans_impl.hpp
+++ b/src/mlpack/methods/kmeans/pelleg_moore_kmeans_impl.hpp
@@ -39,7 +39,8 @@ PellegMooreKMeans<MetricType, MatType>::PellegMooreKMeans(
 template<typename MetricType, typename MatType>
 PellegMooreKMeans<MetricType, MatType>::~PellegMooreKMeans()
 {
-  delete tree;
+  if (tree)
+    delete tree;
 }
 
 // Run a single iteration.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git



More information about the debian-science-commits mailing list