Skip to content

Commit 943395f

Browse files
matrixisevstinner
authored andcommitted
bpo-36333: Fix leak _PyRuntimeState_Fini (GH-12400)
1 parent e130a07 commit 943395f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix leak in _PyRuntimeState_Fini. Contributed by Stéphane Wirtel.

‎Python/pystate.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ _PyRuntimeState_Fini(_PyRuntimeState *runtime)
9292
runtime->interpreters.mutex = NULL;
9393
}
9494

95+
if (runtime->xidregistry.mutex != NULL) {
96+
PyThread_free_lock(runtime->xidregistry.mutex);
97+
runtime->xidregistry.mutex = NULL;
98+
}
99+
95100
PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc);
96101
}
97102

0 commit comments

Comments
 (0)