From 0b75c1ef267c5eaf00966035b0ba3115384352b2 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 8 Jul 2015 10:14:11 -0700 Subject: [PATCH] client.destroy takes a callback --- client.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) {