mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
PyGILState cleanup was too early - destructors called via module cleanup may use the API.
This commit is contained in:
parent
ecd2fdca0f
commit
6cb9029a22
1 changed files with 5 additions and 5 deletions
|
|
@ -254,11 +254,6 @@ Py_Finalize(void)
|
||||||
call_sys_exitfunc();
|
call_sys_exitfunc();
|
||||||
initialized = 0;
|
initialized = 0;
|
||||||
|
|
||||||
/* Cleanup auto-thread-state */
|
|
||||||
#ifdef WITH_THREAD
|
|
||||||
_PyGILState_Fini();
|
|
||||||
#endif /* WITH_THREAD */
|
|
||||||
|
|
||||||
/* Get current thread state and interpreter pointer */
|
/* Get current thread state and interpreter pointer */
|
||||||
tstate = PyThreadState_Get();
|
tstate = PyThreadState_Get();
|
||||||
interp = tstate->interp;
|
interp = tstate->interp;
|
||||||
|
|
@ -310,6 +305,11 @@ Py_Finalize(void)
|
||||||
*/
|
*/
|
||||||
_PyExc_Fini();
|
_PyExc_Fini();
|
||||||
|
|
||||||
|
/* Cleanup auto-thread-state */
|
||||||
|
#ifdef WITH_THREAD
|
||||||
|
_PyGILState_Fini();
|
||||||
|
#endif /* WITH_THREAD */
|
||||||
|
|
||||||
/* Clear interpreter state */
|
/* Clear interpreter state */
|
||||||
PyInterpreterState_Clear(interp);
|
PyInterpreterState_Clear(interp);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue