From e10c651db05c4d2c69618e49db0f24280e93f5ff Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 13 Sep 2016 12:07:29 -0700 Subject: [PATCH] Fix port stream end bug Emitting `end` or `close` was not ending the stream. Pushing a null packet also closes a stream, so I did that instead. Fixes #616 --- app/scripts/lib/port-stream.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/scripts/lib/port-stream.js b/app/scripts/lib/port-stream.js index 1889e3c04..6f59d4485 100644 --- a/app/scripts/lib/port-stream.js +++ b/app/scripts/lib/port-stream.js @@ -30,8 +30,7 @@ PortDuplexStream.prototype._onMessage = function (msg) { PortDuplexStream.prototype._onDisconnect = function () { try { - // this.end() - this.emit('close') + this.push(null) } catch (err) { this.emit('error', err) }