tests: plug leaks when running with --trackmem

(using SDL_VIDEO_DRIVER=x11/wayland on Linux)
This commit is contained in:
Anonymous Maarten
2023-08-22 18:44:28 +02:00
committed by Anonymous Maarten
parent f42bbeca24
commit 2a01f9dcb5
11 changed files with 93 additions and 97 deletions

View File

@@ -10,8 +10,6 @@
freely.
*/
#include <stdlib.h>
#ifdef __EMSCRIPTEN__
#include <emscripten/emscripten.h>
#endif
@@ -42,17 +40,6 @@ static SDL_Cursor *cursor = NULL;
static SDL_bool relative_mode = SDL_FALSE;
static const SDL_DisplayMode *highlighted_mode = NULL;
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
static void
quit(int rc)
{
SDLTest_CommonQuit(state);
/* Let 'main()' return normally */
if (rc != 0) {
exit(rc);
}
}
/* Draws the modes menu, and stores the mode index under the mouse in highlighted_mode */
static void
draw_modes_menu(SDL_Window *window, SDL_Renderer *renderer, SDL_FRect viewport)
@@ -298,7 +285,7 @@ int main(int argc, char *argv[])
#endif
SDL_DestroyCursor(cursor);
quit(0);
/* keep the compiler happy ... */
SDLTest_CleanupTextDrawing();
SDLTest_CommonQuit(state);
return 0;
}