Commit ed58a611 authored by Stefan Behnel's avatar Stefan Behnel

it should be enough to restart tracking the object at the end of tp_dealloc()...

it should be enough to restart tracking the object at the end of tp_dealloc() only if there really is a base type that might rely on it

--HG--
extra : rebase_source : 8a20a41f35f9b5d1aaa2a916b52403bd0cb145fc
parent d25a639a
...@@ -1158,12 +1158,12 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -1158,12 +1158,12 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.put_xdecref_memoryviewslice("p->%s" % entry.cname, code.put_xdecref_memoryviewslice("p->%s" % entry.cname,
have_gil=True) have_gil=True)
if base_type:
# The base class deallocator probably expects this to be tracked, so # The base class deallocator probably expects this to be tracked, so
# undo the untracking above. # undo the untracking above.
if scope.needs_gc(): if scope.needs_gc():
code.putln("PyObject_GC_Track(o);") code.putln("PyObject_GC_Track(o);")
if base_type:
tp_dealloc = TypeSlots.get_base_slot_function(scope, tp_slot) tp_dealloc = TypeSlots.get_base_slot_function(scope, tp_slot)
if tp_dealloc is not None: if tp_dealloc is not None:
code.putln("%s(o);" % tp_dealloc) code.putln("%s(o);" % tp_dealloc)
......
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