Commit 1e62cf79 authored by Stefan Behnel's avatar Stefan Behnel

Avoid a dangling pointer in the global "__pyx_m" variable while decrefing it.

parent d1b7e9af
......@@ -2466,7 +2466,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
# user code in atexit or other global registries.
##code.put_decref_clear(env.module_dict_cname, py_object_type, nanny=False)
code.putln('}')
code.put_decref_clear(env.module_cname, py_object_type, nanny=False)
code.put_decref_clear(env.module_cname, py_object_type, nanny=False, clear_before_decref=True)
code.putln('} else if (!PyErr_Occurred()) {')
code.putln('PyErr_SetString(PyExc_ImportError, "init %s");' % env.qualified_name)
code.putln('}')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment