From 36a4c2208aa9e46c1dfdfe71626ef38256ddab16 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 18 Mar 2016 15:55:12 -0700 Subject: [PATCH] null out bound functions --- server.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server.js b/server.js index a6cf5e4..ca7d366 100644 --- a/server.js +++ b/server.js @@ -622,9 +622,15 @@ Server.prototype._onWebSocketClose = function (socket) { socket.peerId = null socket.infoHashes = null socket.onSend = null + socket.removeListener('message', socket.onMessageBound) + socket.onMessageBound = null + socket.removeListener('error', socket.onErrorBound) + socket.onErrorBound = null + socket.removeListener('close', socket.onCloseBound) + socket.onCloseBound = null } Server.prototype._onWebSocketError = function (socket, err) {