Commit 6cb9029a authored by Mark Hammond's avatar Mark Hammond

PyGILState cleanup was too early - destructors called via module cleanup may use the API.

parent ecd2fdca
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment