From 94b5487847b4f4501b93751f9f24010e72334bf8 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 15 Jul 2017 23:59:45 -0700 Subject: [PATCH] workers: minor. --- lib/workers/workerpool.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/workers/workerpool.js b/lib/workers/workerpool.js index 5038acb9..b289aa79 100644 --- a/lib/workers/workerpool.js +++ b/lib/workers/workerpool.js @@ -118,8 +118,9 @@ WorkerPool.prototype.spawn = function spawn(id) { child.on('exit', (code) => { this.emit('exit', code, child); - if (this.children.get(child.id) === child) - this.children.delete(child.id); + + if (this.children.get(id) === child) + this.children.delete(id); }); child.on('event', (items) => {