mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
GH-118095: Make invalidating and clearing executors memory safe (GH-118459)
This commit is contained in:
parent
21c09d9f81
commit
f6fab21721
5 changed files with 103 additions and 42 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue