From 3c5b9360ed143b84c707e226bfb4d6a1e926fb93 Mon Sep 17 00:00:00 2001 From: aynik Date: Sat, 4 Apr 2015 15:23:57 +0200 Subject: [PATCH] Fixed not closing stream and returning --- src/helper.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/helper.js b/src/helper.js index ebf3628..148e608 100644 --- a/src/helper.js +++ b/src/helper.js @@ -38,7 +38,8 @@ function getLines(filename, from, to, callback) { if (gtn) lines = lines.concat(data.slice(lines.length ? 0 : from - count - 1)); if (gtm) { stream.removeListener("end", endReached); - callback(null, lines.slice(0, to - from)); + stream.close(); + return callback(null, lines.slice(0, to - from)); } count = next; });