diff --git a/client.js b/client.js index 4315f51..12f0641 100644 --- a/client.js +++ b/client.js @@ -234,7 +234,7 @@ Client.prototype.setInterval = function (intervalMs) { }) } -Client.prototype.destroy = function () { +Client.prototype.destroy = function (cb) { var self = this debug('destroy') @@ -243,6 +243,7 @@ Client.prototype.destroy = function () { tracker.setInterval(0) // stop announcing on intervals }) self._trackers = [] + if (cb) process.nextTick(function () { cb(null) }) } Client.prototype._defaultAnnounceOpts = function (opts) {