summaryrefslogtreecommitdiffstats
path: root/Objects/codeobject.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-05-01 10:34:50 (GMT)
committerGitHub <noreply@github.com>2024-05-01 10:34:50 (GMT)
commitf6fab21721c8aedc5dca97dbeb6292a067c19bf1 (patch)
tree53f1c935bc1a956b45f826cb1302c24b285240a7 /Objects/codeobject.c
parent21c09d9f8195433f34b72ddfa25dd1bda3019ed7 (diff)
downloadcpython-f6fab21721c8aedc5dca97dbeb6292a067c19bf1.zip
cpython-f6fab21721c8aedc5dca97dbeb6292a067c19bf1.tar.gz
cpython-f6fab21721c8aedc5dca97dbeb6292a067c19bf1.tar.bz2
GH-118095: Make invalidating and clearing executors memory safe (GH-118459)
Diffstat (limited to 'Objects/codeobject.c')
-rw-r--r--Objects/codeobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index 605167c..810f847 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -1504,7 +1504,8 @@ clear_executors(PyCodeObject *co)
assert(co->co_executors);
for (int i = 0; i < co->co_executors->size; i++) {
if (co->co_executors->executors[i]) {
- _Py_ExecutorClear(co->co_executors->executors[i]);
+ _Py_ExecutorDetach(co->co_executors->executors[i]);
+ assert(co->co_executors->executors[i] == NULL);
}
}
PyMem_Free(co->co_executors);