Skip to content

Commit

Permalink
gh-100348: Fix ref cycle in asyncio._SelectorSocketTransport with `…
Browse files Browse the repository at this point in the history
…_read_ready_cb` (#100349)
  • Loading branch information
rkojedzinszky authored Dec 20, 2022
1 parent 39dfbb2 commit a6331b6
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 a6331b6

Please sign in to comment.