From 25454343e284515aa2f375f885f8a4670aa1117d Mon Sep 17 00:00:00 2001 From: cpasjuste Date: Fri, 16 Mar 2018 17:14:53 +0100 Subject: [PATCH] SWITCH: properly close thread --- src/thread/switch/SDL_systhread.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/thread/switch/SDL_systhread.c b/src/thread/switch/SDL_systhread.c index b3bd286ed..4a54e3e4a 100644 --- a/src/thread/switch/SDL_systhread.c +++ b/src/thread/switch/SDL_systhread.c @@ -67,18 +67,14 @@ SDL_threadID SDL_ThreadID(void) void SDL_SYS_WaitThread(SDL_Thread *thread) { threadWaitForExit(&thread->handle); + threadClose(&thread->handle); } void SDL_SYS_DetachThread(SDL_Thread *thread) { - // TODO ? - threadClose(&thread->handle); -} - -void SDL_SYS_KillThread(SDL_Thread *thread) -{ - // TODO ? - threadClose(&thread->handle); + if (thread->handle.handle) { + threadClose(&thread->handle); + } } int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority)