File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2124,6 +2124,9 @@ _Py_Finalize(_PyRuntimeState *runtime)
21242124 _PyImport_FiniExternal (tstate -> interp );
21252125 finalize_modules (tstate );
21262126
2127+ /* Clean up any lingering subinterpreters. */
2128+ finalize_subinterpreters ();
2129+
21272130 /* Print debug stats if any */
21282131 _PyEval_Fini ();
21292132
@@ -2155,11 +2158,6 @@ _Py_Finalize(_PyRuntimeState *runtime)
21552158 so it is possible to use tracemalloc in objects destructor. */
21562159 _PyTraceMalloc_Fini ();
21572160
2158- /* Clean up any lingering subinterpreters. It is important this happens
2159- AFTER tracemalloc finalizes, as tracemalloc may hold references to
2160- frame data in other interpreters. */
2161- finalize_subinterpreters ();
2162-
21632161 /* Finalize any remaining import state */
21642162 // XXX Move these up to where finalize_modules() is currently.
21652163 _PyImport_FiniCore (tstate -> interp );
You can’t perform that action at this time.
0 commit comments