From 4128604301391bf61f9db070c0005d3b63b62ea2 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 29 Jul 2015 03:21:31 -0700 Subject: [PATCH] remove socket from pool on destroy --- lib/client/websocket-tracker.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/client/websocket-tracker.js b/lib/client/websocket-tracker.js index 15435dc..2eaf420 100644 --- a/lib/client/websocket-tracker.js +++ b/lib/client/websocket-tracker.js @@ -73,6 +73,8 @@ WebSocketTracker.prototype.destroy = function (onclose) { self.destroyed = true clearInterval(self.interval) + socketPool[self.announceUrl] = null + self.socket.removeListener('data', self._onSocketDataBound) self.socket.removeListener('close', self._onSocketCloseBound) self.socket.removeListener('error', self._onSocketErrorBound)