| Summary: | atexit() in test/testime.c | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Ozkan Sezer <sezeroz> |
| Component: | *don't know* | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | trivial | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | All | ||
| OS: | All | ||
I removed exit() from testime, thanks! https://hg.libsdl.org/SDL/rev/b83e2eaed190 |
It is bad practice doing atexit(SDL_Quit), because calling conventions may be different. A quick fix for test/testime.c is using a wrapper, like: diff -r f7abcb63e51e test/testime.c --- a/test/testime.c Sun Aug 13 01:00:01 2017 -0400 +++ b/test/testime.c Sun Aug 13 11:23:10 2017 +0300 @@ -623,6 +623,10 @@ void Redraw() { } } +static void quit (void) { + SDL_Quit(); +} + int main(int argc, char *argv[]) { int i, done; SDL_Event event; @@ -680,7 +684,7 @@ int main(int argc, char *argv[]) { #endif SDL_Log("Using font: %s\n", fontname); - atexit(SDL_Quit); + atexit(quit); InitInput(); /* Create the windows and initialize the renderers */