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:
parent
bb5882bafe
commit
d0e3b8a886
1 changed files with 9 additions and 4 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue