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

intrusive_ptr bug fix #1674

Merged
merged 1 commit into from
Apr 20, 2017
Merged

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Apr 20, 2017

I realized that if intrusive_ptr<T>::reset(T*) is called with a pointer
to the same object it already refers to, it could be erroneously freed
because it was decrementing the existing refcnt before incrementing the
refcnt of the new value. So rewrote reset() to be safe under that
circumstance.

I realized that if intrusive_ptr<T>::reset(T*) is called with a pointer
to the same object it already refers to, it could be erroneously freed
because it was decrementing the existing refcnt before incrementing the
refcnt of the new value. So rewrote reset() to be safe under that
circumstance.
@fpsunflower
Copy link
Contributor

LGTM

@lgritz lgritz merged commit 3a637eb into AcademySoftwareFoundation:master Apr 20, 2017
@lgritz lgritz deleted the lg-ref branch April 20, 2017 16:38
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Apr 20, 2017
I realized that if intrusive_ptr<T>::reset(T*) is called with a pointer
to the same object it already refers to, it could be erroneously freed
because it was decrementing the existing refcnt before incrementing the
refcnt of the new value. So rewrote reset() to be safe under that
circumstance.
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.

2 participants