| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ad69207 commit 9bea207
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,6 +8,7 @@ class SocketListSend extends EventEmitter { | |||
| 8 | 8 | super(); | |
| 9 | 9 | this.key = key; | |
| 10 | 10 | this.child = child; | |
| 11 | + child.once('exit', () => this.emit('exit', this)); | ||
| 11 | 12 | } | |
| 12 | 13 | ||
| 13 | 14 | _request(msg, cmd, callback) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1664,6 +1664,10 @@ Server.prototype.listenFD = internalUtil.deprecate(function(fd, type) { | |||
| 1664 | 1664 | Server.prototype._setupSlave = function(socketList) { | |
| 1665 | 1665 | this._usingSlaves = true; | |
| 1666 | 1666 | this._slaves.push(socketList); | |
| 1667 | + socketList.once('exit', (socketList) => { | ||
| 1668 | + const index = this._slaves.indexOf(socketList); | ||
| 1669 | + this._slaves.splice(index, 1); | ||
| 1670 | + }); | ||
| 1667 | 1671 | }; | |
| 1668 | 1672 | ||
| 1669 | 1673 | Server.prototype.ref = function() { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -156,6 +156,7 @@ if (process.argv[2] === 'child') { | |||
| 156 | 156 | } | |
| 157 | 157 | ||
| 158 | 158 | process.on('exit', function() { | |
| 159 | + assert.strictEqual(server._slaves.length, 0); | ||
| 159 | 160 | assert.strictEqual(disconnected, count); | |
| 160 | 161 | assert.strictEqual(connected, count); | |
| 161 | 162 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments