From: Shinigami92 Date: Sun, 7 Feb 2021 12:05:04 +0000 (+0100) Subject: Fix rebase conflict X-Git-Tag: v2.0.0-beta.2~80^2~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=68b2f517f24cdfc11a9eb8147b8c2c15927ff079;p=poolifier.git Fix rebase conflict --- diff --git a/src/dynamic.ts b/src/dynamic.ts index d413ee39..667fa07a 100644 --- a/src/dynamic.ts +++ b/src/dynamic.ts @@ -64,6 +64,10 @@ export default class DynamicThreadPool< if (message.kill) { worker.postMessage({ kill: 1 }) worker.terminate() + // clean workers from data structures + const workerIndex = this.workers.indexOf(worker) + this.workers.splice(workerIndex, 1) + this.tasks.delete(worker) } }) return worker