mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
Issue #10241: Clear extension module dict copies at interpreter shutdown.
Patch by Neil Schemenauer, minimally modified. (re-apply after fix for tkinter-related crash)
This commit is contained in:
parent
584e815114
commit
40322e6ad5
4 changed files with 33 additions and 0 deletions
|
@ -380,6 +380,8 @@ PyImport_Cleanup(void)
|
|||
builtins = interp->builtins;
|
||||
interp->builtins = PyDict_New();
|
||||
Py_DECREF(builtins);
|
||||
/* Clear module dict copies stored in the interpreter state */
|
||||
_PyState_ClearModules();
|
||||
/* Collect references */
|
||||
_PyGC_CollectNoFail();
|
||||
/* Dump GC stats before it's too late, since it uses the warnings
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue