summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorKumar Aditya <59607654+kumaraditya303@users.noreply.github.com>2022-10-22 16:11:27 (GMT)
committerGitHub <noreply@github.com>2022-10-22 16:11:27 (GMT)
commit62bf5d8d0a36112619436a813ceefb7e4af52c24 (patch)
treec8d41f8bbde8e32568146ba8ba3cbcbb791abde0 /Lib/asyncio
parentf4a14941e6e54b15012fca067f6a9b2ff29f201a (diff)
downloadcpython-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.py7
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: