diff options
author | Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> | 2022-10-22 16:11:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-22 16:11:27 (GMT) |
commit | 62bf5d8d0a36112619436a813ceefb7e4af52c24 (patch) | |
tree | c8d41f8bbde8e32568146ba8ba3cbcbb791abde0 /Lib/asyncio | |
parent | f4a14941e6e54b15012fca067f6a9b2ff29f201a (diff) | |
download | cpython-62bf5d8d0a36112619436a813ceefb7e4af52c24.zip cpython-62bf5d8d0a36112619436a813ceefb7e4af52c24.tar.gz cpython-62bf5d8d0a36112619436a813ceefb7e4af52c24.tar.bz2 |
GH-98539: fix ref cycle in `_SSLProtocolTransport` after close (#98540)
Diffstat (limited to 'Lib/asyncio')
-rw-r--r-- | Lib/asyncio/sslproto.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py index de00953..5cb5cd3 100644 --- a/Lib/asyncio/sslproto.py +++ b/Lib/asyncio/sslproto.py @@ -107,8 +107,11 @@ class _SSLProtocolTransport(transports._FlowControlMixin, protocol's connection_lost() method will (eventually) called with None as its argument. """ - self._closed = True - self._ssl_protocol._start_shutdown() + if not self._closed: + self._closed = True + self._ssl_protocol._start_shutdown() + else: + self._ssl_protocol = None def __del__(self, _warnings=warnings): if not self._closed: |