fix: unref mobile fit cleanup timers (#4245)

This commit is contained in:
Neil
2026-05-31 09:29:29 -07:00
committed by GitHub
parent 7a92f9b4b8
commit 7fd8b0b8de
+8
View File
@@ -4382,6 +4382,9 @@ export class OrcaRuntimeService {
this.setDriver(ptyId, { kind: 'idle' })
}
}, SOFT_LEAVE_GRACE_MS)
if (typeof softTimer.unref === 'function') {
softTimer.unref()
}
this.pendingSoftLeavers.set(ptyId, {
clientId,
timer: softTimer,
@@ -4435,6 +4438,11 @@ export class OrcaRuntimeService {
rows: restoreRows
})
}, autoRestoreMs)
// Why: a delayed mobile restore should not keep Electron main alive
// after the last window/runtime transport has otherwise shut down.
if (typeof timer.unref === 'function') {
timer.unref()
}
this.pendingRestoreTimers.set(ptyId, { timer, clientId })
}