summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-09-13 14:16:46 +0000
committerAntoine Pitrou <solipsis@pitrou.net>2010-09-13 14:16:46 +0000
commit64b32a2e48eecce58447ae9f0c678464720eb960 (patch)
treef10b752b6e1ccb5c2d566ce0c2f8395e56e1ee9e /Python/pythonrun.c
parenteda372fa5744b71b6b43c810ac0f4f0e88e2d3c6 (diff)
downloadcpython-64b32a2e48eecce58447ae9f0c678464720eb960.tar.gz
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.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index fd31974cb8..8f4e9f18f7 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -514,6 +514,10 @@ Py_Finalize(void)
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