Commit 56b6a6d9 authored by Stefan Behnel's avatar Stefan Behnel

be a tiny bit smarter about when to GC_Track for the base type in tp_dealloc()

parent 1010f578
......@@ -1243,8 +1243,11 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if needs_gc:
# The base class deallocator probably expects this to be tracked,
# so undo the untracking above.
code.putln("if (PyType_IS_GC(Py_TYPE(o)->tp_base))"
" PyObject_GC_Track(o);")
if base_type.scope and base_type.scope.needs_gc():
code.putln("PyObject_GC_Track(o);")
else:
code.putln("if (PyType_IS_GC(Py_TYPE(o)->tp_base))"
" PyObject_GC_Track(o);")
tp_dealloc = TypeSlots.get_base_slot_function(scope, tp_slot)
if tp_dealloc is not None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment