mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-13 19:06:27 +00:00
invoke callbacks of destroyed trackers
This commit is contained in:
parent
55884194a2
commit
09e2b55e42
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user