Skip to content
Permalink
Browse files

Fixed a minor memory leak in the SDL thread subsystem

  • Loading branch information
slouken committed Apr 11, 2002
1 parent 0c22a9a commit 2621ffabcb5d4b0f5631c898e42c7f1e6e24c849
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/thread/SDL_thread.c
@@ -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",

0 comments on commit 2621ffa

Please sign in to comment.