Commit 6f43ea68 authored by Stefan Behnel's avatar Stefan Behnel

use arbitrary but predictable C code order when cleaning up imported extension types

parent 4020171d
......@@ -2214,9 +2214,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln("__Pyx_CleanupGlobals();")
if Options.generate_cleanup_code >= 3:
code.putln("/*--- Type import cleanup code ---*/")
for type in env.types_imported:
for ext_type in sorted(env.types_imported, key=operator.attrgetter('typeptr_cname')):
code.put_xdecref_clear(
type.typeptr_cname, type,
ext_type.typeptr_cname, ext_type,
clear_before_decref=True,
nanny=False)
if Options.cache_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