From 8db076cf8af4fddfc1e406ec579d559abc53304c Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Sun, 30 Oct 2011 19:13:55 +0100 Subject: Issue #10363: Deallocate global locks in Py_Finalize(). --- Python/pystate.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Python/pystate.c') diff --git a/Python/pystate.c b/Python/pystate.c index b347c41c54..40699af499 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -150,6 +150,12 @@ PyInterpreterState_Delete(PyInterpreterState *interp) *p = interp->next; HEAD_UNLOCK(); free(interp); +#ifdef WITH_THREAD + if (interp_head == NULL && head_mutex != NULL) { + PyThread_free_lock(head_mutex); + head_mutex = NULL; + } +#endif } -- cgit v1.2.1