gh-100348: Fix ref cycle in `asyncio._SelectorSocketTransport` with `_read_ready_cb` (#100349)

This commit is contained in:
Richard Kojedzinszky 2022-12-20 11:40:56 +01:00 committed by GitHub
parent 39dfbb2d5d
commit a6331b605e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -1133,6 +1133,10 @@ class _SelectorSocketTransport(_SelectorTransport):
def _reset_empty_waiter(self): def _reset_empty_waiter(self):
self._empty_waiter = None self._empty_waiter = None
def close(self):
self._read_ready_cb = None
super().close()
class _SelectorDatagramTransport(_SelectorTransport, transports.DatagramTransport): class _SelectorDatagramTransport(_SelectorTransport, transports.DatagramTransport):

View File

@ -0,0 +1,2 @@
Fix ref cycle in :class:`!asyncio._SelectorSocketTransport` by removing ``_read_ready_cb`` in ``close``.