From 1df1536fb98c1c2bbeefe373bc38877129f905e1 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Mon, 13 Sep 2010 14:16:46 +0000 Subject: 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. --- Python/pythonrun.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Python/pythonrun.c') 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 -- cgit v1.2.1