From f6ae7f7164d2e900efe0742b2cce74ce58eb1e6b Mon Sep 17 00:00:00 2001 From: Michael Heuberger Date: Thu, 12 Dec 2024 20:36:43 +1300 Subject: [PATCH] fix unloading --- src/wrappers/container.ts | 6 +++--- src/wrappers/visuals.ts | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/wrappers/container.ts b/src/wrappers/container.ts index 5102206f..fed915fc 100644 --- a/src/wrappers/container.ts +++ b/src/wrappers/container.ts @@ -452,12 +452,12 @@ class Container extends Despot { this.unloadChildren(params); this.hide(); - + } catch (exc) { + this.emit("ERROR", { exc }); + } finally { Despot.removeAllListeners(); this.built = this.submitted = false; - } catch (exc) { - this.emit("ERROR", { exc }); } } diff --git a/src/wrappers/visuals.ts b/src/wrappers/visuals.ts index 526f88d7..b3bee254 100644 --- a/src/wrappers/visuals.ts +++ b/src/wrappers/visuals.ts @@ -258,7 +258,6 @@ class Visuals extends Despot { this.options.logger.debug(`Visuals: unload(${e ? pretty(e) : ""})`); - Despot.removeAllListeners(); this.recorder.unload(params); this.recorderInsides.unload(); this.replay.unload(params);