New submission from Petr Viktorin:

The example object in the xxlimited module can be part of a reference loop (it 
can contain itself), so it needs GC and tp_traverse.

The tp_dealloc hook was incorrect, and a correct version would be difficult to 
generalize for something more complicated than a example class (#16690; [0]). 
It's better to avoid dealloc and show off tp_finalize.

Same for the class in _testmultiphase (PEP 489 tests), which is based on 
xxlimited. The incorrect dealloc is causing the reference leak mentioned in 
#24268.

The Xxo object also wasn't actually added to the module.

Here is a patch to fix these.

[0] https://mail.python.org/pipermail/python-dev/2015-June/140422.html

----------
components: Extension Modules
files: xxlimited-finalize.patch
keywords: patch
messages: 244743
nosy: encukou, ncoghlan
priority: normal
severity: normal
status: open
title: Use traverse & finalize in xxlimited and in PEP 489 tests
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file39605/xxlimited-finalize.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24373>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to