Fixed a minor memory leak in the SDL thread subsystem

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40341
This commit is contained in:
Sam Lantinga 2002-04-11 21:08:44 +00:00
parent bb5882bafe
commit d0e3b8a886

View file

@ -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",