mirror of
https://github.com/python/cpython.git
synced 2026-02-07 10:20:33 +00:00
[3.14] gh-144307: Fix a reference leak during module teardown (GH-144308) (GH-144327)
gh-144307: Fix a reference leak during module teardown (GH-144308)
(cherry picked from commit 219b7ac9d5)
Signed-off-by: Yongtao Huang <yongtaoh2022@gamil.com>
Co-authored-by: Yongtao Huang <yongtaoh2022@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
This commit is contained in:
parent
de1b2cce30
commit
49ce23f2d7
2 changed files with 2 additions and 0 deletions
|
|
@ -1601,6 +1601,7 @@ finalize_remove_modules(PyObject *modules, int verbose)
|
|||
PyObject *value = PyObject_GetItem(modules, key);
|
||||
if (value == NULL) {
|
||||
PyErr_FormatUnraisable("Exception ignored while removing modules");
|
||||
Py_DECREF(key);
|
||||
continue;
|
||||
}
|
||||
CLEAR_MODULE(key, value);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue