summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 1418d03..635616c 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -1609,6 +1609,7 @@ tstate_delete_common(PyThreadState *tstate)
{
assert(tstate->_status.cleared && !tstate->_status.finalized);
assert(tstate->state != _Py_THREAD_ATTACHED);
+ tstate_verify_not_active(tstate);
PyInterpreterState *interp = tstate->interp;
if (interp == NULL) {
@@ -1687,8 +1688,8 @@ _PyThreadState_DeleteCurrent(PyThreadState *tstate)
_Py_qsbr_detach(((_PyThreadStateImpl *)tstate)->qsbr);
#endif
tstate_set_detached(tstate, _Py_THREAD_DETACHED);
- tstate_delete_common(tstate);
current_fast_clear(tstate->interp->runtime);
+ tstate_delete_common(tstate);
_PyEval_ReleaseLock(tstate->interp, NULL);
free_threadstate((_PyThreadStateImpl *)tstate);
}