Skip to content

Commit

Permalink
- call SDL_Quit() from main() instead of atexit()
Browse files Browse the repository at this point in the history
This should help with crash reporting during SDL shutdown
  • Loading branch information
alexey-lysiuk committed Oct 11, 2019
1 parent 3a54b10 commit 08a66ab
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/posix/sdl/i_main.cpp
Expand Up @@ -173,7 +173,6 @@ int main (int argc, char **argv)
fprintf (stderr, "Could not initialize SDL:\n%s\n", SDL_GetError());
return -1;
}
atexit (SDL_Quit); // This one should NOT be in the engine's list of exit handlers!

printf("\n");

Expand All @@ -195,5 +194,10 @@ int main (int argc, char **argv)
}

I_StartupJoysticks();
return D_DoomMain ();

const int result = D_DoomMain();

SDL_Quit();

return result;
}

0 comments on commit 08a66ab

Please sign in to comment.