mirror of
https://github.com/yawut/SDL.git
synced 2026-04-18 06:46:04 -05:00
Fixed a minor memory leak in the SDL thread subsystem
This commit is contained in:
parent
247f6e23bb
commit
292c10f4fa
|
|
@ -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…
Reference in New Issue
Block a user