mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-14 11:26:25 +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) {
|
HTTPTracker.prototype.destroy = function (cb) {
|
||||||
var self = this
|
var self = this
|
||||||
if (self.destroyed) return
|
if (self.destroyed) return cb && cb()
|
||||||
self.destroyed = true
|
self.destroyed = true
|
||||||
clearInterval(self.interval)
|
clearInterval(self.interval)
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ UDPTracker.prototype.scrape = function (opts) {
|
|||||||
|
|
||||||
UDPTracker.prototype.destroy = function (cb) {
|
UDPTracker.prototype.destroy = function (cb) {
|
||||||
var self = this
|
var self = this
|
||||||
if (self.destroyed) return
|
if (self.destroyed) return cb && cb()
|
||||||
self.destroyed = true
|
self.destroyed = true
|
||||||
clearInterval(self.interval)
|
clearInterval(self.interval)
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ WebSocketTracker.prototype.scrape = function (opts) {
|
|||||||
|
|
||||||
WebSocketTracker.prototype.destroy = function (onclose) {
|
WebSocketTracker.prototype.destroy = function (onclose) {
|
||||||
var self = this
|
var self = this
|
||||||
if (self.destroyed) return
|
if (self.destroyed) return onclose && onclose()
|
||||||
self.destroyed = true
|
self.destroyed = true
|
||||||
clearInterval(self.interval)
|
clearInterval(self.interval)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user