fix: ensure event listeners are removed at worker set stop
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 11 Dec 2023 18:03:46 +0000 (19:03 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 11 Dec 2023 18:03:46 +0000 (19:03 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/worker/WorkerSet.ts

index c5df860ced4fc85b16e7067c805605b05db75e04..62ddf8079f2f6377cd0f95fe62daac629a27a9bb 100644 (file)
@@ -95,6 +95,7 @@ export class WorkerSet extends WorkerAbstract<WorkerData> {
       await waitWorkerExit;
       this.emitter?.emit(WorkerSetEvents.stopped, this.info);
       this.emitter?.emitDestroy();
+      this.emitter?.removeAllListeners();
       this.started = false;
     }
   }