From 2fff18cb611f747066cd0d53a5a8b17011a87ec4 Mon Sep 17 00:00:00 2001 From: j433866 Date: Tue, 30 Apr 2019 15:23:41 +0100 Subject: [PATCH] Don't create a new loaderWorker until we need one. This was causing issues on single core systems after I got rid of the active status as we had already reached the max number of workers. Instead, we just create a loaderWorker when needed as loaderWorkers are small enough! --- src/web/InputWaiter.mjs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/web/InputWaiter.mjs b/src/web/InputWaiter.mjs index 25ac9564..da1bb71e 100644 --- a/src/web/InputWaiter.mjs +++ b/src/web/InputWaiter.mjs @@ -91,9 +91,6 @@ class InputWaiter { }); this.inputWorker.addEventListener("message", this.handleInputWorkerMessage.bind(this)); - if (this.loaderWorkers.length === 0) { - this.activateLoaderWorker(); - } } @@ -101,7 +98,7 @@ class InputWaiter { * Activates a loaderWorker and sends it to the InputWorker */ activateLoaderWorker() { - const workerIdx = this.addLoaderWorker(true); + const workerIdx = this.addLoaderWorker(); if (workerIdx === -1) return; const workerObj = this.loaderWorkers[workerIdx]; @@ -117,7 +114,6 @@ class InputWaiter { /** * Adds a new loaderWorker * - * @param {boolean} [active=false] * @returns {number} The index of the created worker */ addLoaderWorker() {