[mlpack] [mlpack/mlpack] using rvalue references to set a given reference tree in FastMKS and DualTreeBoruvka (#799)
Ryan Curtin
notifications at github.com
Mon Nov 28 10:30:18 EST 2016
rcurtin commented on this pull request.
>
if (treeOwner && referenceTree)
delete referenceTree;
+
+ referenceTree = new Tree(tree);
+ referenceSet = &tree->Dataset();
I bet the problem is in this line. Shouldn't this be `referenceSet = &referenceTree->Dataset()`? Otherwise you are setting the pointer to the dataset of the tree that the user passed in, which isn't guaranteed to be a valid pointer outside the scope of this function.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/799
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://knife.lugatgt.org/pipermail/mlpack/attachments/20161128/9d3bd3fc/attachment.html>
More information about the mlpack
mailing list