8000 [3.10] bpo-42972: Fully support GC for _winapi.Overlapped (GH-26381) by Fidget-Spinner · Pull Request #26430 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.10] bpo-42972: Fully support GC for _winapi.Overlapped (GH-26381) #26430

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 2 commits into from
May 28, 2021
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
untrack earlier
  • Loading branch information
Fidget-Spinner committed May 28, 2021
commit a171907ad03fd929f32be0ccc9fb26d93e66bb88
2 changes: 1 addition & 1 deletion Modules/_winapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ overlapped_dealloc(OverlappedObject *self)
DWORD bytes;
int err = GetLastError();

PyObject_GC_UnTrack(self);
if (self->pending) {
if (check_CancelIoEx() &&
Py_CancelIoEx(self->handle, &self->overlapped) &&
Expand Down Expand Up @@ -164,7 +165,6 @@ overlapped_dealloc(OverlappedObject *self)

CloseHandle(self->overlapped.hEvent);
SetLastError(err);
PyObject_GC_UnTrack(self);
if (self->write_buffer.obj)
PyBuffer_Release(&self->write_buffer);
Py_CLEAR(self->read_buffer);
Expand Down
0