Skip to content

Commit

Permalink
Frame clear, clear locals
Browse files Browse the repository at this point in the history
f_locals might still contain references to the local vars.

Fix python#113939.
  • Loading branch information
albertz authored Jan 11, 2024
1 parent 9f08833 commit 5010796
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Objects/frameobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,7 @@ frame_tp_clear(PyFrameObject *f)
Py_CLEAR(locals[i]);
}
f->f_frame->stacktop = 0;
Py_CLEAR(f->f_frame->f_locals);
return 0;
}

Expand Down

0 comments on commit 5010796

Please sign in to comment.