mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-140080: Clear atexit callbacks when memory allocation fails during finalization (GH-140103)
This fixes a regression introduced by GH-136004, in which finalization would hang while executing atexit handlers if the system was out of memory. --------- Signed-off-by: yihong0618 <zouzou0208@gmail.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
32c264982e
commit
a05aece543
3 changed files with 36 additions and 1 deletions
|
|
@ -112,6 +112,7 @@ atexit_callfuncs(struct atexit_state *state)
|
|||
{
|
||||
PyErr_FormatUnraisable("Exception ignored while "
|
||||
"copying atexit callbacks");
|
||||
atexit_cleanup(state);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue