From: Robert Bradshaw Date: Fri, 10 Apr 2009 06:05:40 +0000 (-0700) Subject: Ticket #270, CEnumDefNode leaks memory during construction X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f62ca61fbdd1d88357b1b2e007c5c071a457d52a;p=cython.git Ticket #270, CEnumDefNode leaks memory during construction --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index a51027c6..eadcab11 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -916,12 +916,13 @@ class CEnumDefNode(StatNode): self.temp, item.cname, code.error_goto_if_null(self.temp, item.pos))) + code.put_gotref(self.temp) code.putln('if (__Pyx_SetAttrString(%s, "%s", %s) < 0) %s' % ( Naming.module_cname, item.name, self.temp, code.error_goto(item.pos))) - code.putln("%s = 0;" % self.temp) + code.put_decref_clear(self.temp, PyrexTypes.py_object_type) class CEnumDefItemNode(StatNode):