Skip to content

Commit

Permalink
bpo-36333: Fix leak _PyRuntimeState_Fini (pythonGH-12400)
Browse files Browse the repository at this point in the history
  • Loading branch information
matrixise authored and vstinner committed Mar 19, 2019
1 parent e130a07 commit 943395f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix leak in _PyRuntimeState_Fini. Contributed by Stéphane Wirtel.
5 changes: 5 additions & 0 deletions Python/pystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 943395f

Please sign in to comment.