-
Notifications
You must be signed in to change notification settings - Fork 491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug report: memory corruption #179
Comments
even worse thing just happened in my code: inputData was implicitly converted and a temporary object was passed to the constructor. |
@jlblancoc ping |
Merged #180. I'll however leave this one open to remember to add a comment to that ctor warning the users about expected lifetimes. |
Thanks! |
@AndreyMlashkin Thanks! |
in the constructor of KDTreeSingleIndexAdaptor, you expect inputData lifetime should be longer rather then Adaptor itself, but it is not always true and user of the code can easily break it.
for exmple, calling this would cause indefined behaviour:
ModelKDTreeIndex index(2, std::vector {}, nanoflann::KDTreeSingleIndexAdaptorParams(10));
The text was updated successfully, but these errors were encountered: