Skip to content

Clean weakrefs before calling user's dealloc#2930

Merged
scoder merged 1 commit intocython:masterfrom
pablogsal:2929
Apr 27, 2019
Merged

Clean weakrefs before calling user's dealloc#2930
scoder merged 1 commit intocython:masterfrom
pablogsal:2929

Conversation

@pablogsal
Copy link
Contributor

We must clean the weakreferences before calling the user's dealloc
because if the dealloc releases the GIL, a weakref can be
dereferenced accessing the object in an inconsistent state or
resurrecting it.

Closes #2929

We must clean the weakreferences before calling the user's __dealloc__
because if the __dealloc__ releases the GIL, a weakref can be
dereferenced accessing the object in an inconsistent state or
resurrecting it.
@scoder scoder added this to the 3.0 milestone Apr 27, 2019
@scoder
Copy link
Contributor

scoder commented Apr 27, 2019

Thanks

@scoder scoder merged commit d5da2db into cython:master Apr 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tp_dealloc generated code is unsafe for weak references

2 participants