Skip to content

Commit

Permalink
pythongh-100348: Fix ref cycle in asyncio._SelectorSocketTransport
Browse files Browse the repository at this point in the history
…with `_read_ready_cb` (python#100349)
  • Loading branch information
rkojedzinszky authored and jonburdo committed Dec 20, 2022
1 parent f9b6796 commit 77d160f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Lib/asyncio/selector_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,10 @@ def _make_empty_waiter(self):
def _reset_empty_waiter(self):
self._empty_waiter = None

def close(self):
self._read_ready_cb = None
super().close()


class _SelectorDatagramTransport(_SelectorTransport, transports.DatagramTransport):

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix ref cycle in :class:`!asyncio._SelectorSocketTransport` by removing ``_read_ready_cb`` in ``close``.

0 comments on commit 77d160f

Please sign in to comment.