Skip to content

Commit

Permalink
Fix race condition with finish
Browse files Browse the repository at this point in the history
(allow last pull to run before `finish === true`)
  • Loading branch information
ZJONSSON committed Jan 13, 2017
1 parent c21c86d commit 8d04171
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/PullStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ function PullStream() {
this.buffer = new Buffer('');
var self = this;
self.on('finish',function() {
self.finished = true;
self.emit('chunk',false);
process.nextTick(function() {
self.finished = true;
});
});
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unzipper",
"version": "0.7.3",
"version": "0.7.4",
"description": "Unzip cross-platform streaming API ",
"author": "Evan Oxfeld <eoxfeld@gmail.com>",
"contributors": [
Expand Down

0 comments on commit 8d04171

Please sign in to comment.