Commit d0e3b8a8 authored by Sam Lantinga's avatar Sam Lantinga

Fixed a minor memory leak in the SDL thread subsystem

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40341
parent bb5882ba
......@@ -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",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment