Skip to content

Commit

Permalink
Fixed a minor memory leak in the SDL thread subsystem
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Apr 11, 2002
1 parent 0c22a9a commit 2621ffa
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/thread/SDL_thread.c
Expand Up @@ -146,10 +146,15 @@ static void SDL_DelThread(SDL_Thread *thread)
}
}
if ( i < SDL_numthreads ) {
--SDL_numthreads;
while ( i < SDL_numthreads ) {
SDL_Threads[i] = SDL_Threads[i+1];
++i;
if ( --SDL_numthreads > 0 ) {
while ( i < SDL_numthreads ) {
SDL_Threads[i] = SDL_Threads[i+1];
++i;
}
} else {
SDL_maxthreads = 0;
free(SDL_Threads);
SDL_Threads = NULL;
}
#ifdef DEBUG_THREADS
printf("Deleting thread (%d left - %d max)\n",
Expand Down

0 comments on commit 2621ffa

Please sign in to comment.