mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
bpo-42208: Call GC collect earlier in PyInterpreterState_Clear() (GH-23044)
The last GC collection is now done before clearing builtins and sys dictionaries. Add also assertions to ensure that gc.collect() is no longer called after _PyGC_Fini(). Pass also the tstate to PyInterpreterState_Clear() to pass the correct tstate to _PyGC_CollectNoFail() and _PyGC_Fini().
This commit is contained in:
parent
4fe72090de
commit
eba5bf2f56
4 changed files with 35 additions and 15 deletions
|
|
@ -267,6 +267,7 @@ extern PyStatus _PyInterpreterState_SetConfig(
|
|||
PyInterpreterState *interp,
|
||||
const PyConfig *config);
|
||||
|
||||
extern void _PyInterpreterState_Clear(PyThreadState *tstate);
|
||||
|
||||
|
||||
/* cross-interpreter data registry */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue