8000 gh-116437: Use new C API PyDict_Pop() to simplify the code by serhiy-storchaka · Pull Request #116438 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-116437: Use new C API PyDict_Pop() to simplify the code #116438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix a leak in _localdummy_destroyed.
  • Loading branch information
serhiy-storchaka committed Mar 6, 2024
commit 989fd4f8880981f632c8e62b5db5b94fe2b92e4b
3 changes: 1 addition & 2 deletions Modules/_threadmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1262,8 +1262,7 @@ _localdummy_destroyed(PyObject *localweakref, PyObject *dummyweakref)
/* If the thread-local object is still alive and not being cleared,
remove the corresponding local dict */
if (self->dummies != NULL) {
PyObject *ldict;
if (PyDict_Pop(self->dummies, dummyweakref, &ldict) < 0)
if (PyDict_Pop(self->dummies, dummyweakref, NULL) < 0)
PyErr_WriteUnraisable((PyObject*)self);
}
Py_DECREF(self);
Expand Down
0