diff Python/pythonrun.c @ 64709:557e2537c9ae

Issue #9828: Destroy the GIL in Py_Finalize(), so that it gets properly re-created on a subsequent call to Py_Initialize(). The problem (a crash) wouldn't appear in 3.1 or 2.7 where the GIL's structure is more trivial.
author Antoine Pitrou <solipsis@pitrou.net>
date Mon, 13 Sep 2010 14:16:46 +0000
parents 687cc854cb4b
children 38b0d5d0dd30
line wrap: on
line diff
--- a/Python/pythonrun.c	Mon Sep 13 07:18:30 2010 +0000
+++ b/Python/pythonrun.c	Mon Sep 13 14:16:46 2010 +0000
@@ -514,6 +514,10 @@
 
     PyGrammar_RemoveAccelerators(&_PyParser_Grammar);
 
+#ifdef WITH_THREAD
+    _PyEval_FiniThreads();
+#endif
+
 #ifdef Py_TRACE_REFS
     /* Display addresses (& refcnts) of all objects still alive.
      * An address can be used to find the repr of the object, printed