mirror of https://github.com/python/cpython
bpo-44032: Delay deletion of stack chunks until thread state is deleted. (GH-26285)
This commit is contained in:
parent
3ad101b317
commit
af5d497f72
|
@ -897,13 +897,6 @@ PyThreadState_Clear(PyThreadState *tstate)
|
|||
if (tstate->on_delete != NULL) {
|
||||
tstate->on_delete(tstate->on_delete_data);
|
||||
}
|
||||
_PyStackChunk *chunk = tstate->datastack_chunk;
|
||||
tstate->datastack_chunk = NULL;
|
||||
while (chunk != NULL) {
|
||||
_PyStackChunk *prev = chunk->previous;
|
||||
_PyObject_VirtualFree(chunk, chunk->size);
|
||||
chunk = prev;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -936,6 +929,13 @@ tstate_delete_common(PyThreadState *tstate,
|
|||
{
|
||||
PyThread_tss_set(&gilstate->autoTSSkey, NULL);
|
||||
}
|
||||
_PyStackChunk *chunk = tstate->datastack_chunk;
|
||||
tstate->datastack_chunk = NULL;
|
||||
while (chunk != NULL) {
|
||||
_PyStackChunk *prev = chunk->previous;
|
||||
_PyObject_VirtualFree(chunk, chunk->size);
|
||||
chunk = prev;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue