fix(minecraft): nullify EventRegistry context on stop() to prevent stale handler execution
When stop() is called before detachFromBot(), mineflayer listeners remain attached. Nullifying context ensures handleMineflayerEvent's guard clause silently ignores any events that fire in this window.
This commit is contained in:
@@ -96,6 +96,10 @@ export class EventRegistry {
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
}
|
||||
// NOTICE: Nullify context so that any stale mineflayer listeners that fire
|
||||
// after stop() (but before detachFromBot()) are silently ignored by the
|
||||
// guard at the top of handleMineflayerEvent.
|
||||
this.context = null
|
||||
}
|
||||
|
||||
public getDebugSnapshot(): SaliencySnapshot {
|
||||
|
||||
Reference in New Issue
Block a user