From: Stefan Behnel Date: Sat, 4 Aug 2012 13:39:35 +0000 (+0200) Subject: safely clear ext type fields on tp_dealloc() X-Git-Tag: 0.17b2~26 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0295811ddb4a51c0d4be1da0ec54973bdcaefc82;p=platform%2Fupstream%2Fpython-cython.git safely clear ext type fields on tp_dealloc() --- diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 2472de3..2ac80ad 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -1102,7 +1102,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): code.putln("p->%s.~%s();" % (entry.cname, class_name)); for entry in py_attrs: - code.put_xdecref("p->%s" % entry.cname, entry.type, nanny=False) + code.put_xdecref_clear("p->%s" % entry.cname, entry.type, nanny=False, + clear_before_decref=True) for entry in memoryview_slices: code.put_xdecref_memoryviewslice("p->%s" % entry.cname,