diff --git a/lib/client/http-tracker.js b/lib/client/http-tracker.js index c8be443..ec10cc4 100644 --- a/lib/client/http-tracker.js +++ b/lib/client/http-tracker.js @@ -74,7 +74,7 @@ HTTPTracker.prototype.scrape = function (opts) { HTTPTracker.prototype.destroy = function (cb) { var self = this - if (self.destroyed) return + if (self.destroyed) return cb && cb() self.destroyed = true clearInterval(self.interval) diff --git a/lib/client/udp-tracker.js b/lib/client/udp-tracker.js index 4bd98a5..8aec7e1 100644 --- a/lib/client/udp-tracker.js +++ b/lib/client/udp-tracker.js @@ -47,7 +47,7 @@ UDPTracker.prototype.scrape = function (opts) { UDPTracker.prototype.destroy = function (cb) { var self = this - if (self.destroyed) return + if (self.destroyed) return cb && cb() self.destroyed = true clearInterval(self.interval) diff --git a/lib/client/websocket-tracker.js b/lib/client/websocket-tracker.js index 773aa83..df73062 100644 --- a/lib/client/websocket-tracker.js +++ b/lib/client/websocket-tracker.js @@ -66,7 +66,7 @@ WebSocketTracker.prototype.scrape = function (opts) { WebSocketTracker.prototype.destroy = function (onclose) { var self = this - if (self.destroyed) return + if (self.destroyed) return onclose && onclose() self.destroyed = true clearInterval(self.interval)