From: Jérôme Benoit Date: Sun, 11 Feb 2024 12:33:26 +0000 (+0100) Subject: fix: do not leak event listeners at charging station deletion X-Git-Tag: v1.2.36~10 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=6767e9f1c0c3f54684eec2f01ae958272c786ca5;p=e-mobility-charging-stations-simulator.git fix: do not leak event listeners at charging station deletion Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 8a5c5c6f..9da4fdbb 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -686,6 +686,7 @@ export class ChargingStation extends EventEmitter { deleteConfiguration && rmSync(this.configurationFile, { force: true }) this.chargingStationWorkerBroadcastChannel.unref() this.emit(ChargingStationEvents.deleted) + this.removeAllListeners() } public start (): void {