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
…ythonGH-98540)

(cherry picked from commit 62bf5d8)

Co-authored-by: Kumar Aditya <[email protected]>
  • Loading branch information
kumaraditya303 authored and miss-islington committed Oct 22, 2022
1 parent 9713cac commit 1d222d3
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 1d222d3

Please sign in to comment.