-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
Reference leak with custom tp_dealloc in PyType_FromSpec #60894
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
Comments
There is a reference leak when using PyType_FromSpec with custom tp_dealloc. This was first noted in issue bpo-15142, where a fix was given which only applies to types which do not override tp_dealloc. For example, the xxlimited.Xxo type suffers from this: Python 3.3.0 (default, Oct 26 2012, 11:06:17)
[GCC 4.6.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import xxlimited
>>> import sys
>>> Xxo = type(xxlimited.new())
>>> e = Xxo()
>>> sys.getrefcount(Xxo)
7
>>> e = Xxo()
>>> sys.getrefcount(Xxo)
8
>>> e = Xxo()
>>> sys.getrefcount(Xxo)
9 |
I see this issue came up in the course of bpo-15653 as well. |
The attached file Unfortunately |
New changeset 265eeb60443a by Nick Coghlan in branch '3.5': |
This is fixed in Python 3.5+. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: