invoke callbacks of destroyed trackers

This commit is contained in:
Autarc 2016-03-14 17:13:34 +01:00
parent 55884194a2
commit 09e2b55e42
3 changed files with 3 additions and 3 deletions

View File

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

View File

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

View File

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