From 985e59ffa749f8ca8148f17a2abf7147e232ac5d Mon Sep 17 00:00:00 2001 From: Brice Waegeneire Date: Thu, 26 Apr 2018 03:50:30 +0200 Subject: [PATCH] fix EventEmitter memory leak --- lib/torrent.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/torrent.js b/lib/torrent.js index c0e8aafc..8a0f1669 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -1500,9 +1500,6 @@ Torrent.prototype._request = function (wire, index, hotswap) { wire.request(index, chunkOffset, chunkLength, function onChunk (err, chunk) { if (self.destroyed) return - // TODO: what is this for? - if (!self.ready) return self.once('ready', function () { onChunk(err, chunk) }) - if (r[i] === wire) r[i] = null if (piece !== self.pieces[index]) return onUpdateTick()