Guest User

Untitled

a guest
Jan 21st, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. diff --git a/src/mlpack/core/metrics/ip_metric_impl.hpp b/src/mlpack/core/metrics/ip_metric_impl.hpp
  2. index d39026593..5155eb380 100644
  3. --- a/src/mlpack/core/metrics/ip_metric_impl.hpp
  4. +++ b/src/mlpack/core/metrics/ip_metric_impl.hpp
  5. @@ -65,6 +65,10 @@ template<typename Archive>
  6. void IPMetric<KernelType>::serialize(Archive& ar,
  7. const unsigned int /* version */)
  8. {
  9. + // Delete an existing kernel.
  10. + if (kernelOwner)
  11. + delete kernel;
  12. +
  13. // If we're loading, we need to allocate space for the kernel, and we will own
  14. // the kernel.
  15. if (Archive::is_loading::value)
Add Comment
Please, Sign In to add comment