diff Python/pystate.c @ 73205:608975eafe86 3.2

Issue #10363: Deallocate global locks in Py_Finalize().
author Antoine Pitrou <solipsis@pitrou.net>
date Sun, 30 Oct 2011 19:13:55 +0100
parents 2caf82aee7a4
children ba90839c4993 728595c16acd
line wrap: on
line diff
--- a/Python/pystate.c	Sun Oct 30 14:31:27 2011 +0200
+++ b/Python/pystate.c	Sun Oct 30 19:13:55 2011 +0100
@@ -150,6 +150,12 @@
     *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
 }