From 3e4b4cac66308800d93509d77eb0a66fbd4cdcad Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sun, 14 Apr 2013 15:42:24 -0400 Subject: [PATCH] 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 #382. --- tornado/websocket.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tornado/websocket.py b/tornado/websocket.py index 4d06af96..7bc65138 100644 --- a/tornado/websocket.py +++ b/tornado/websocket.py @@ -210,6 +210,7 @@ class WebSocketHandler(tornado.web.RequestHandler): Once the close handshake is successful the socket will be closed. """ self.ws_connection.close() + self.ws_connection = None def allow_draft76(self): """Override to enable support for the older "draft76" protocol.