From: Jérôme Benoit Date: Mon, 11 Dec 2023 18:03:46 +0000 (+0100) Subject: fix: ensure event listeners are removed at worker set stop X-Git-Tag: v1.2.30~26 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f073768188fce66e052bbc15d7a87b601bcf039e;p=e-mobility-charging-stations-simulator.git fix: ensure event listeners are removed at worker set stop Signed-off-by: Jérôme Benoit --- diff --git a/src/worker/WorkerSet.ts b/src/worker/WorkerSet.ts index c5df860c..62ddf807 100644 --- a/src/worker/WorkerSet.ts +++ b/src/worker/WorkerSet.ts @@ -95,6 +95,7 @@ export class WorkerSet extends WorkerAbstract { await waitWorkerExit; this.emitter?.emit(WorkerSetEvents.stopped, this.info); this.emitter?.emitDestroy(); + this.emitter?.removeAllListeners(); this.started = false; } }