remove socket from pool on destroy

This commit is contained in:
Feross Aboukhadijeh 2015-07-29 03:21:31 -07:00
parent 2061eb9818
commit 4128604301

View File

@ -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)