Skip to content

Commit 3e4b4ca

Browse files
committed
Break reference cycle between WebSocketHandler and WebSocketProtocol on close.
This isn't strictly necessary, but it allows the refcounting CPython GC to clean things up without waiting for a full GC. Closes tornadoweb#382.
1 parent 6e00a75 commit 3e4b4ca

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tornado/websocket.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ def close(self):
210210
Once the close handshake is successful the socket will be closed.
211211
"""
212212
self.ws_connection.close()
213+
self.ws_connection = None
213214

214215
def allow_draft76(self):
215216
"""Override to enable support for the older "draft76" protocol.

0 commit comments

Comments
 (0)