summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index b347c41..40699af 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
}