[mlpack-git] master: Fix memory leak. (5a444b0)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Tue Dec 22 17:02:20 EST 2015
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/6ab20afd8adaf9dcb86bc9a8ea98a24dd8b18743...eb41f4bc27b484c347acc006255104e2f8cc4eef
>---------------------------------------------------------------
commit 5a444b02eb36a52c300e4b093c41db21ba6dd932
Author: ryan <ryan at ratml.org>
Date: Tue Dec 22 16:44:14 2015 -0500
Fix memory leak.
>---------------------------------------------------------------
5a444b02eb36a52c300e4b093c41db21ba6dd932
src/mlpack/core/metrics/ip_metric_impl.hpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/mlpack/core/metrics/ip_metric_impl.hpp b/src/mlpack/core/metrics/ip_metric_impl.hpp
index 27a7819..80e3980 100644
--- a/src/mlpack/core/metrics/ip_metric_impl.hpp
+++ b/src/mlpack/core/metrics/ip_metric_impl.hpp
@@ -62,8 +62,10 @@ void IPMetric<KernelType>::Serialize(Archive& ar,
// If we're loading, we need to allocate space for the kernel, and we will own
// the kernel.
if (Archive::is_loading::value)
+ {
kernel = new KernelType();
- kernelOwner = true;
+ kernelOwner = true;
+ }
ar & data::CreateNVP(kernel, "kernel");
}
More information about the mlpack-git
mailing list