mirror of
https://github.com/python/cpython.git
synced 2024-11-23 09:54:58 +08:00
bpo-42972: Fix GC assertion error in _winapi by untracking Overlapped earlier (GH(26429)
This commit is contained in:
parent
0fa282c55f
commit
490b638e63
@ -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) &&
|
||||
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user