From 5b4ac7587438e7adb21e0ff3d9d629b6ff00263a Mon Sep 17 00:00:00 2001 From: Johannes Eder Date: Tue, 24 Aug 2021 12:15:13 +0200 Subject: [PATCH] fix(util-registry): filtering activeUtilInstances when a util is destroyed --- frontend/src/services/util-registry/util-registry.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/services/util-registry/util-registry.js b/frontend/src/services/util-registry/util-registry.js index 2e6115dc0..2b0005a35 100644 --- a/frontend/src/services/util-registry/util-registry.js +++ b/frontend/src/services/util-registry/util-registry.js @@ -104,9 +104,10 @@ export class UtilRegistry { if(DEBUG_MODE > 2) { console.log('Destroying Util: ', {util}); } - let utilIndex = this._activeUtilInstancesWrapped.indexOf(util); util.destroy(); - if (utilIndex >= 0) this._activeUtilInstancesWrapped.splice(utilIndex, 1); + this._activeUtilInstancesWrapped = this._activeUtilInstancesWrapped.filter(utilWrapped => { + return utilWrapped.element === util._element; + }); }); }