Skip to content
Draft
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
3 changes: 1 addition & 2 deletions Modules/_asynciomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2966,13 +2966,12 @@ TaskObj_dealloc(PyObject *self)
if (PyObject_CallFinalizerFromDealloc(self) < 0) {
return; // resurrected
}
PyObject_GC_UnTrack(self);
// unregister the task after finalization so that
// if the task gets resurrected, it remains registered
unregister_task((TaskObj *)self);

PyTypeObject *tp = Py_TYPE(self);
PyObject_GC_UnTrack(self);

PyObject_ClearWeakRefs(self);

(void)TaskObj_clear(self);
Expand Down
Loading