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; + }); }); }