From fbc1d8c395f20d71422e214de7b13d9a513dbaa0 Mon Sep 17 00:00:00 2001 From: Jan Matousek Date: Mon, 16 Mar 2015 12:53:02 +0100 Subject: [PATCH] Fix listeners leak Each call of `bundle` function registered new listeners, while keeping the old one registered. --- bin/cmd.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cmd.js b/bin/cmd.js index bd0a1b1..f98c101 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -31,8 +31,8 @@ function bundle () { wb.pipe(fs.createWriteStream(dotfile)); var bytes, time; - w.on('bytes', function (b) { bytes = b }); - w.on('time', function (t) { time = t }); + w.once('bytes', function (b) { bytes = b }); + w.once('time', function (t) { time = t }); wb.on('end', function () { fs.rename(dotfile, outfile, function (err) {