bpo-36333: Fix leak _PyRuntimeState_Fini (GH-12400)

This commit is contained in:
Stéphane Wirtel 2019-03-19 11:51:32 +01:00 committed by Victor Stinner
parent e130a07eb2
commit 943395fab9
2 changed files with 6 additions and 0 deletions

View File

@ -0,0 +1 @@
Fix leak in _PyRuntimeState_Fini. Contributed by Stéphane Wirtel.

View File

@ -92,6 +92,11 @@ _PyRuntimeState_Fini(_PyRuntimeState *runtime)
runtime->interpreters.mutex = NULL;
}
if (runtime->xidregistry.mutex != NULL) {
PyThread_free_lock(runtime->xidregistry.mutex);
runtime->xidregistry.mutex = NULL;
}
PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc);
}