clear global reference to module dict in module cleanup code
authorStefan Behnel <stefan_ml@behnel.de>
Sun, 13 Oct 2013 13:33:25 +0000 (15:33 +0200)
committerStefan Behnel <stefan_ml@behnel.de>
Sun, 13 Oct 2013 13:33:25 +0000 (15:33 +0200)
Cython/Compiler/ModuleNode.py

index f65f9d9..a50702a 100644 (file)
@@ -2197,6 +2197,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
         code.putln('#if CYTHON_COMPILING_IN_PYPY')
         code.putln('Py_CLEAR(%s);' % Naming.builtins_cname)
         code.putln('#endif')
+        code.put_decref_clear(env.module_dict_cname, py_object_type,
+                              nanny=False, clear_before_decref=True)
 
     def generate_main_method(self, env, code):
         module_is_main = "%s%s" % (Naming.module_is_main, self.full_module_name.replace('.', '__'))