From ee7c1da0e12c70134f31537a1c1e7040d309af5a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 29 Nov 2023 15:27:19 +0100 Subject: [PATCH] fix: ensure event listeners are always removed at simulator stop MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/Bootstrap.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index 9fc4f19f..66207645 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -194,6 +194,7 @@ export class Bootstrap extends EventEmitter { } await this.workerImplementation?.stop(); delete this.workerImplementation; + this.removeAllListeners(); this.uiServer?.stop(); await this.storage?.close(); delete this.storage; @@ -229,7 +230,6 @@ export class Bootstrap extends EventEmitter { this.numberOfChargingStations, ) .then(() => { - this.removeAllListeners(); resolve('Charging stations stopped'); }) .catch(reject) -- 2.34.1