Skip to content

Commit 86144fc

Browse files
committed
Clear the thread-local.
1 parent 779be6e commit 86144fc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Python/pystate.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ _PyRuntimeState_Fini(_PyRuntimeState *runtime)
402402
/* The count is cleared by _Py_FinalizeRefTotal(). */
403403
assert(runtime->object_state.interpreter_leaks == 0);
404404
#endif
405+
gilstate_clear();
405406
}
406407

407408
#ifdef HAVE_FORK
@@ -433,6 +434,7 @@ _PyRuntimeState_ReInitThreads(_PyRuntimeState *runtime)
433434
#endif
434435

435436
_PyTypes_AfterFork();
437+
gilstate_clear();
436438

437439
_PyThread_AfterFork(&runtime->threads);
438440

0 commit comments

Comments
 (0)