Skip to content

Commit

Permalink
pythonGH-98539: fix ref cycle in _SSLProtocolTransport after close (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaraditya303 committed Oct 22, 2022
1 parent f4a1494 commit 62bf5d8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Lib/asyncio/sslproto.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,11 @@ def close(self):
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:
Expand Down

0 comments on commit 62bf5d8

Please sign in to comment.