From: Mark Hammond Date: Tue, 22 Apr 2003 11:18:00 +0000 (+0000) Subject: PyGILState cleanup was too early - destructors called via module cleanup may use... X-Git-Tag: v2.3c1~1086 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6cb9029a2273ae2d9ca3c3a0a7fe1111111c2713;p=python PyGILState cleanup was too early - destructors called via module cleanup may use the API. --- diff --git a/Python/pythonrun.c b/Python/pythonrun.c index e5759b7eec..a8dedde7c1 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -254,11 +254,6 @@ Py_Finalize(void) call_sys_exitfunc(); initialized = 0; - /* Cleanup auto-thread-state */ -#ifdef WITH_THREAD - _PyGILState_Fini(); -#endif /* WITH_THREAD */ - /* Get current thread state and interpreter pointer */ tstate = PyThreadState_Get(); interp = tstate->interp; @@ -310,6 +305,11 @@ Py_Finalize(void) */ _PyExc_Fini(); + /* Cleanup auto-thread-state */ +#ifdef WITH_THREAD + _PyGILState_Fini(); +#endif /* WITH_THREAD */ + /* Clear interpreter state */ PyInterpreterState_Clear(interp);