[issue8212] A tp_dealloc of a subclassed class cannot resurrect an object
Kristján Valur Jónsson
report at bugs.python.org
Sun Apr 15 14:31:09 CEST 2012
Kristján Valur Jónsson <kristjan at ccpgames.com> added the comment:
Here is a patch that rectifies this situation, albeit in a somewhat 'hacky' manner.
It works by injecting a monitoring 'tp_free' call into the type during the basedealloc call, which sets a flag if it was called with the object, i.e. if actual deletion took place.
This value is then returned, and a decision to decref the object's "type" is made on this result.
----------
keywords: +patch
versions: +Python 3.3 -Python 3.2
Added file: http://bugs.python.org/file25222/basedealloc.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8212>
_______________________________________
More information about the Python-bugs-list
mailing list