fix: fix events listener cleanup
[poolifier.git] / src / pools / abstract-pool.ts
index eb92eb548903a719169f15e658ccbfe86cefe4be..53b7b430efcc626c317e2186e7dbd4b409944dd6 100644 (file)
@@ -989,6 +989,7 @@ export abstract class AbstractPool<
     )
     this.emitter?.emit(PoolEvents.destroy, this.info)
     this.emitter?.emitDestroy()
+    this.emitter?.removeAllListeners()
     this.readyEventEmitted = false
     this.destroying = false
     this.started = false