fix: do not leak event listeners at charging station deletion
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 11 Feb 2024 12:33:26 +0000 (13:33 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 11 Feb 2024 12:33:26 +0000 (13:33 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts

index 8a5c5c6fba84ed66b0fb33a32de578bcc3f4ee62..9da4fdbb41934219468867ed824b94fd3fb36cd3 100644 (file)
@@ -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 {