Skip to content
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

Ensure custom deleter is called by passing non-null pointer in ctor #6161

Conversation

anmelle-slamcore
Copy link
Contributor

Custom deleters for std::unique_ptr are not invoked if the owned pointer is null.
Therefore, the function setup to acquire_metadata at the end of the scope will never fire.

Solution is to pass a valid pointer, and let the custom deleter delete the object.

@dorodnic
Copy link
Contributor

dorodnic commented Mar 30, 2020

Hi @anmelleSlamcore
Thank you for the patch, I was not familiar with this behaviour.

Copy link
Collaborator

@ev-mp ev-mp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @anmelleSlamcore ,
Thank you for the contribution!

@ev-mp ev-mp merged commit 44e4cfb into IntelRealSense:development Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants