Skip to content

Commit 7fc200b

Browse files
committed
Use interpreter shutdown instead of runtime shutdown
1 parent dcb709d commit 7fc200b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Objects/obmalloc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,10 @@ free_delayed(uintptr_t ptr)
11091109
#ifndef Py_GIL_DISABLED
11101110
free_work_item(ptr);
11111111
#else
1112-
if (Py_IsFinalizing() || _PyRuntime.stoptheworld.world_stopped) {
1112+
PyInterpreterState *interp = _PyInterpreterState_GET();
1113+
if (_PyInterpreterState_GetFinalizing(interp) != NULL ||
1114+
interp->stoptheworld.world_stopped)
1115+
{
11131116
// Free immediately during interpreter shutdown or if the world is
11141117
// stopped.
11151118
free_work_item(ptr);

0 commit comments

Comments
 (0)