Skip to content

Commit

Permalink
Merge pull request #631 from laamaa/bugfix/wayland_crash_on_exit
Browse files Browse the repository at this point in the history
call SDL_Quit() on exit to prevent a crash on app exit with linux/wayland
  • Loading branch information
LIJI32 authored Jun 19, 2024
2 parents b5cd06a + 496baaf commit 3116f63
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SDL/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,10 @@ int main(int argc, char **argv)
#endif

SDL_Init(SDL_INIT_EVERYTHING & ~SDL_INIT_AUDIO);
// This is, essentially, best-effort.
// This function will not be called if the process is terminated in any way, anyhow.
atexit(SDL_Quit);

if ((console_supported = CON_start(completer))) {
CON_set_repeat_empty(true);
CON_printf("SameBoy v" GB_VERSION "\n");
Expand Down

0 comments on commit 3116f63

Please sign in to comment.