]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Break reference cycle between WebSocketHandler and WebSocketProtocol on close.
authorBen Darnell <ben@bendarnell.com>
Sun, 14 Apr 2013 19:42:24 +0000 (15:42 -0400)
committerBen Darnell <ben@bendarnell.com>
Sun, 14 Apr 2013 19:42:24 +0000 (15:42 -0400)
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

index 4d06af965e6b984004ae1ad7c5d2398129251bc0..7bc651386b40a2b670e50116a538e0893bd15c1e 100644 (file)
@@ -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.