From dfe6efcd2df1b7781ce9bbcf86963bafda589b5e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 28 Jul 2024 07:51:31 -0700 Subject: [PATCH] Fixed memory leak in testthread --- test/testthread.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/testthread.c b/test/testthread.c index 2c50200ca6..4dd8d9c223 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -20,6 +20,7 @@ #include static SDL_TLSID tls; +static SDL_Thread *thread = NULL; static int alive = 0; static int testprio = 0; static SDLTest_CommonState *state; @@ -83,13 +84,13 @@ killed(int sig) SDL_Log("Killed with SIGTERM, waiting 5 seconds to exit\n"); SDL_Delay(5 * 1000); alive = 0; + SDL_WaitThread(thread, NULL); quit(0); } int main(int argc, char *argv[]) { int i; - SDL_Thread *thread; /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, 0);