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)
  • Loading branch information
slouken committed Sep 5, 2024
1 parent a75227a commit 224a37f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/testthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "SDL_test.h"

static SDL_TLSID tls;
static SDL_Thread *thread = NULL;
static SDL_atomic_t alive;
static int testprio = 0;
static SDLTest_CommonState *state;
Expand Down Expand Up @@ -80,13 +81,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 i = 1;
SDL_Thread *thread;
int i;

state = SDLTest_CommonCreateState(argv, 0);
if (!state) {
Expand Down

0 comments on commit 224a37f

Please sign in to comment.