Fix rebase conflict
authorShinigami92 <chrissi92@hotmail.de>
Sun, 7 Feb 2021 12:05:04 +0000 (13:05 +0100)
committerShinigami92 <chrissi92@hotmail.de>
Sun, 7 Feb 2021 12:05:04 +0000 (13:05 +0100)
src/dynamic.ts

index d413ee3968a96dbcfea53cb95d512646438652e3..667fa07a29780a4837c8f5a7f3af7643c8bb61e4 100644 (file)
@@ -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