Skip to content

Commit

Permalink
Fixed memory leak in testthread
Browse files Browse the repository at this point in the history
(cherry picked from commit dfe6efc)
(cherry picked from commit 224a37f)
  • Loading branch information
slouken committed Sep 5, 2024
1 parent ba9b075 commit e5bb4fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/testthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "SDL.h"

static SDL_TLSID tls;
static SDL_Thread *thread = NULL;
static SDL_atomic_t alive;
static int testprio = 0;

Expand Down Expand Up @@ -77,13 +78,13 @@ killed(int sig)
SDL_Log("Killed with SIGTERM, waiting 5 seconds to exit\n");
SDL_Delay(5 * 1000);
SDL_AtomicSet(&alive, 0);
SDL_WaitThread(thread, NULL);
quit(0);
}

int main(int argc, char *argv[])
{
int arg = 1;
SDL_Thread *thread;

/* Enable standard application logging */
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
Expand Down

0 comments on commit e5bb4fa

Please sign in to comment.