don't loose outer closure scope while we still need it
authorStefan Behnel <scoder@users.berlios.de>
Thu, 30 Apr 2009 16:23:32 +0000 (18:23 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Thu, 30 Apr 2009 16:23:32 +0000 (18:23 +0200)
Cython/Compiler/Nodes.py

index 0f784d811740aaeffb23a877b57157b9f2479c68..a43e5168cb4d3ef86c49163cb30cd1770bbc79a3 100644 (file)
@@ -1069,6 +1069,8 @@ class FuncDefNode(StatNode, BlockNode):
                             outer_scope_cname,
                             env.scope_class.type.declaration_code(''),
                             Naming.self_cname))
+            code.put_incref(outer_scope_cname, py_object_type)
+            code.put_giveref(outer_scope_cname)
         # ----- Fetch arguments
         self.generate_argument_parsing_code(env, code)
         # If an argument is assigned to in the body, we must