Commit Graph
3 Commits
Author SHA1 Message Date
waozi f520b84d22 kry_instance: robust lock stealing + early release
A closing app releases its instance lock only at CloseWindow, after
application cleanup; the old steal loop gave up after 2 s of SIGTERM
nudges, so a launch racing a slow shutdown was rejected with no
window. Widen the budget to 3.5 s, escalate once to SIGKILL guarded
by a /proc/<pid>/comm same-application check (a recycled pid never
takes the hit), and add KryonReleaseInstanceLock() so apps can drop
the lock the moment their main loop ends.
2026-09-03 18:47:10 -03:00
waozi 55144cb63c Make rejected single-instance launches safe instead of crashing
When a second process with the same title-key launches and the lock
holder survives the steal attempts, InitWindow marks the instance
rejected and skips the backend window - but BeginFrame/EndFrame still
drove into rlgl on the never-created GL context and crashed (null
deref on the first frame). Expose InstanceRejected() and make the
frame APIs no-ops in that state so apps can check and exit cleanly.
Regression-tested with an unkillable lock holder: the second instance
is rejected, wants to close, and never opens the drawing backend.
2026-09-01 23:42:33 -03:00
waozi 15020a797b runtime: enforce one app instance by default 2026-08-17 21:46:45 -03:00