Skip to content

Commit 7cbbcf4

Browse files
fix ref cycle
1 parent 8d57423 commit 7cbbcf4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Lib/asyncio/sslproto.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,11 @@ def close(self):
107107
protocol's connection_lost() method will (eventually) called
108108
with None as its argument.
109109
"""
110-
self._closed = True
111-
self._ssl_protocol._start_shutdown()
110+
if not self._closed:
111+
self._closed = True
112+
self._ssl_protocol._start_shutdown()
113+
else:
114+
self._ssl_protocol = None
112115

113116
def __del__(self, _warnings=warnings):
114117
if not self._closed:

0 commit comments

Comments
 (0)