| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3e4f34c commit 2e59ec0
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,6 +10,7 @@ class SocketListSend extends EventEmitter { | |||
| 10 | 10 | super(); | |
| 11 | 11 | this.key = key; | |
| 12 | 12 | this.child = child; | |
| 13 | + child.once('exit', () => this.emit('exit', this)); | ||
| 13 | 14 | } | |
| 14 | 15 | ||
| 15 | 16 | _request(msg, cmd, callback) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1665,6 +1665,10 @@ Server.prototype.listenFD = internalUtil.deprecate(function(fd, type) { | |||
| 1665 | 1665 | Server.prototype._setupWorker = function(socketList) { | |
| 1666 | 1666 | this._usingWorkers = true; | |
| 1667 | 1667 | this._workers.push(socketList); | |
| 1668 | + socketList.once('exit', (socketList) => { | ||
| 1669 | + const index = this._workers.indexOf(socketList); | ||
| 1670 | + this._workers.splice(index, 1); | ||
| 1671 | + }); | ||
| 1668 | 1672 | }; | |
| 1669 | 1673 | ||
| 1670 | 1674 | 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._workers.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