fix method signatures
authorStefan Behnel <scoder@users.berlios.de>
Sun, 30 Nov 2008 12:04:13 +0000 (13:04 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Sun, 30 Nov 2008 12:04:13 +0000 (13:04 +0100)
Cython/Compiler/ExprNodes.py

index 2996db4b98ddb73481718c726d5451741fa4446a..c630849214a0415d6b519ecefef6307f07b9278d 100644 (file)
@@ -3219,10 +3219,12 @@ class DictItemNode(ExprNode):
     def generate_evaluation_code(self, code):
         self.key.generate_evaluation_code(code)
         self.value.generate_evaluation_code(code)
-        
-    def generate_disposal_code(self, code):
-        self.key.generate_disposal_code(code)
-        self.value.generate_disposal_code(code)
+
+    def generate_disposal_code(self, code, free_temp=True, decref=True):
+        self.key.generate_disposal_code(
+            code, free_temp=free_temp, decref=decref)
+        self.value.generate_disposal_code(
+            code, free_temp=free_temp, decref=decref)
         
     def __iter__(self):
         return iter([self.key, self.value])
@@ -4765,7 +4767,7 @@ class CloneNode(CoercionNode):
     def generate_result_code(self, code):
         pass
         
-    def generate_disposal_code(self, code):
+    def generate_disposal_code(self, code, free_temp=True, decref=True):
         pass
                 
     def allocate_temps(self, env):
@@ -4811,9 +4813,9 @@ class PersistentNode(ExprNode):
             self.arg.generate_disposal_code(code)
         self.generate_counter += 1
                 
-    def generate_disposal_code(self, code):
+    def generate_disposal_code(self, code, free_temp=True, decref=True):
         if self.generate_counter == self.uses:
-            if self.type.is_pyobject:
+            if self.type.is_pyobject and decref:
                 code.put_decref_clear(self.result(), self.ctype())
 
     def allocate_temps(self, env, result=None):