await waitWorkerExit;
this.emitter?.emit(WorkerSetEvents.stopped, this.info);
this.emitter?.emitDestroy();
+ this.emitter?.removeAllListeners();
this.started = false;
}
}
if (!this.started) {
throw new Error('Cannot add a WorkerSet element: not started');
}
- if (!this.workerSet) {
+ if (this.workerSet == null) {
throw new Error("Cannot add a WorkerSet element: 'workerSet' property does not exist");
}
const workerSetElement = await this.getWorkerSetElement();