Skip to content

Commit

Permalink
Close file handle when user wants to stop reading
Browse files Browse the repository at this point in the history
The documentation states:

    If the callback returns false, reading will stop and the file will be closed.
  • Loading branch information
Matthew Caruana Galizia committed Jan 11, 2014
1 parent 7dae91b commit 58283de
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/line_reader.js
Expand Up @@ -138,6 +138,7 @@
newRead();
} else {
finish();
reader.close();
}
}

Expand All @@ -152,6 +153,7 @@
newRead();
} else {
finish();
reader.close();
}
}
});
Expand Down

0 comments on commit 58283de

Please sign in to comment.