From f4507231e3f0cf8827cec5592571ce371c6813e8 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sat, 26 Dec 2020 20:26:08 +0100 Subject: bpo-42745: finalize_interp_types() calls _PyType_Fini() (GH-23953) Call _PyType_Fini() in subinterpreters. Fix reference leaks in subinterpreters. --- Python/pylifecycle.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Python/pylifecycle.c') diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index ccbacb48194..9828dffad5c 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1573,6 +1573,7 @@ finalize_interp_types(PyThreadState *tstate) _PyFrame_Fini(tstate); _PyAsyncGen_Fini(tstate); _PyContext_Fini(tstate); + _PyType_Fini(tstate); // Call _PyUnicode_ClearInterned() before _PyDict_Fini() since it uses // a dict internally. _PyUnicode_ClearInterned(tstate); @@ -1751,9 +1752,6 @@ Py_FinalizeEx(void) /* Destroy the database used by _PyImport_{Fixup,Find}Extension */ _PyImport_Fini(); - /* Cleanup typeobject.c's internal caches. */ - _PyType_Fini(tstate); - /* unload faulthandler module */ _PyFaulthandler_Fini(); -- cgit v1.2.3