Fixed reference leak for NewTempExprNode
authorDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Sat, 27 Sep 2008 11:40:27 +0000 (13:40 +0200)
committerDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Sat, 27 Sep 2008 11:40:27 +0000 (13:40 +0200)
Cython/Compiler/ExprNodes.py

index c78f505f4e9a07eca62a419ec912b4b4b96217a8..bea8b1b073d2e9c636b4ed0e02c54e5b91fa9eaa 100644 (file)
@@ -601,6 +601,8 @@ class NewTempExprNode(ExprNode):
 
     def generate_disposal_code(self, code):
         if self.is_temp:
+            if self.type.is_pyobject:
+                code.put_decref_clear(self.result(), self.ctype())
             if not self.backwards_compatible_result:
                 code.funcstate.release_temp(self.temp_code)
         else: