Noticed while probing EventGate during a slack-mcpl review (main 5498805 / v0.19.0).
setSleep arms this.sleepTimer = setTimeout(() => this.wakeFromSleep('sleep-expired'), ms) (src/gate/event-gate.ts ~1663) without unref. dispose() (~1919-1935) clears debounceTimers and selfWakeTimers but never sleepTimer. Probe after dispose(): remainingTimer=true, hasRef=true — the timer keeps the process alive and later fires wakeFromSleep on a disposed gate.
Fix: if (this.sleepTimer) clearTimeout(this.sleepTimer); this.sleepTimer = undefined; in dispose() (and consider unref() at arm time).
Noticed while probing EventGate during a slack-mcpl review (main 5498805 / v0.19.0).
setSleeparmsthis.sleepTimer = setTimeout(() => this.wakeFromSleep('sleep-expired'), ms)(src/gate/event-gate.ts~1663) withoutunref.dispose()(~1919-1935) clearsdebounceTimersandselfWakeTimersbut neversleepTimer. Probe afterdispose():remainingTimer=true, hasRef=true— the timer keeps the process alive and later fireswakeFromSleepon a disposed gate.Fix:
if (this.sleepTimer) clearTimeout(this.sleepTimer); this.sleepTimer = undefined;indispose()(and considerunref()at arm time).