8000 gh-122306: Fix circular reference issue between MemoryView and PickleBuffer during garbage collection by marko1616 · Pull Request #123400 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-122306: Fix circular reference issue between MemoryView and PickleBuffer during garbage collection #123400

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

Closed
Changes from all commits
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
8 changes: 6 additions & 2 deletions Objects/memoryobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1164,8 +1164,12 @@ static int
memory_clear(PyObject *_self)
{
PyMemoryViewObject *self = (PyMemoryViewObject *)_self;
(void)_memory_release(self);
Py_CLEAR(self->mbuf);
if(_memory_release(self) == 0) {
Py_CLEAR(self->mbuf);
}
else {
PyErr_FormatUnraisable("Exception ignored in memoryview clear");
}
return 0;
}

Expand Down
Loading
0