diff options
author | Stéphane Wirtel <stephane@wirtel.be> | 2019-03-19 11:51:32 +0100 |
---|---|---|
committer | Victor Stinner <vstinner@redhat.com> | 2019-03-19 11:51:32 +0100 |
commit | 943395fab925a11ea90d078e771cdfc4443e8c34 (patch) | |
tree | c34e7f3cea05bede1a8cdf4be432eadd803b0696 /Python/pystate.c | |
parent | bpo-36356: Fix memory leak in _PyPreConfig_Read() (GH-12425) (diff) | |
download | cpython-943395fab925a11ea90d078e771cdfc4443e8c34.tar.gz cpython-943395fab925a11ea90d078e771cdfc4443e8c34.tar.bz2 cpython-943395fab925a11ea90d078e771cdfc4443e8c34.zip |
bpo-36333: Fix leak _PyRuntimeState_Fini (GH-12400)
Diffstat (limited to 'Python/pystate.c')
-rw-r--r-- | Python/pystate.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c index 6a2dc102ecf..36566b76715 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -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); } |