GH-98539: fix ref cycle in _SSLProtocolTransport after close (#98540)

This commit is contained in:
Kumar Aditya 2022-10-22 21:41:27 +05:30 committed by GitHub
parent f4a14941e6
commit 62bf5d8d0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: