Commit 1c56349b authored by Lisandro Dalcin's avatar Lisandro Dalcin

Clear imported type pointers in module cleanup

parent 9a238cb7
...@@ -1885,7 +1885,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -1885,7 +1885,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if Options.generate_cleanup_code >= 3: if Options.generate_cleanup_code >= 3:
code.putln("/*--- Type import cleanup code ---*/") code.putln("/*--- Type import cleanup code ---*/")
for type, _ in env.types_imported.items(): for type, _ in env.types_imported.items():
code.putln("Py_DECREF((PyObject *)%s);" % type.typeptr_cname) code.putln("Py_DECREF((PyObject *)%s); %s = 0;" % (
type.typeptr_cname, type.typeptr_cname))
if Options.cache_builtins: if Options.cache_builtins:
code.putln("/*--- Builtin cleanup code ---*/") code.putln("/*--- Builtin cleanup code ---*/")
for entry in env.cached_builtins: for entry in env.cached_builtins:
......
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