Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
Fix GC assertion error in _winapi by untracking Overlapped earlier
  • Loading branch information
Fidget-Spinner committed May 28, 2021
commit eb83148c96738c21f15260c9e1401d2a77ec8779
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