diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2015-07-17 09:16:12 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2015-07-17 09:16:12 +0300 |
commit | 75c56818900720543c7005fd272ef54bbd764bf4 (patch) | |
tree | 6803a2ee462bb69f2a331ac060e3c119e49b30a2 /lib | |
parent | 8309ca73c0179499a4e43c1fef07380cae17aea3 (diff) |
torrent.destroy() remove from client
Diffstat (limited to 'lib')
-rw-r--r-- | lib/torrent.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/torrent.js b/lib/torrent.js index fbff66c..48001ac 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -359,6 +359,8 @@ Torrent.prototype.destroy = function (cb) { self.destroyed = true debug('destroy') + self.client.remove(self) + if (self._rechokeIntervalId) { clearInterval(self._rechokeIntervalId) self._rechokeIntervalId = null @@ -378,6 +380,7 @@ Torrent.prototype.destroy = function (cb) { if (self.swarm) tasks.push(function (cb) { self.swarm.destroy(cb) }) if (self.discovery) tasks.push(function (cb) { self.discovery.stop(cb) }) if (self.storage) tasks.push(function (cb) { self.storage.close(cb) }) + parallel(tasks, cb) } |