Skip to content

Launcher: don't crash when a game quits before its exit is watched - #30

Merged
utkuhalis merged 1 commit into
mainfrom
fix/exit-watch-dead-pid
Oct 30, 2026
Merged

utkuhalis merged 1 commit into
mainfrom
fix/exit-watch-dead-pid

Conversation

@utkuhalis

Copy link
Copy Markdown
Collaborator

A game that quits right after it is opened makes NSRunningApplication report a process id of -1. watchForExit passed that to DispatchSource.makeProcessSource, which traps converting a negative pid to UInt, so the launcher died with SIGTRAP (issue #28, launcher 0.2.28 on an M4). Now a game that is already gone is treated as ended at once, the same path a normal exit takes.

Fixes #28

NSRunningApplication reports a process id of -1 once the game has already
gone, and DispatchSource.makeProcessSource traps converting a negative pid.
Such a game is treated as ended at once.

Fixes #28
@utkuhalis
utkuhalis merged commit 5ca076a into main Oct 30, 2026
10 checks passed
@utkuhalis
utkuhalis deleted the fix/exit-watch-dead-pid branch October 30, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Launcher crash

1 participant