3DS: Fix thread cleanup
Vicki Pfau vi@endrift.com
Mon, 24 Aug 2020 18:24:22 -0700
3 files changed,
5 insertions(+),
6 deletions(-)
M
CHANGES
→
CHANGES
@@ -44,6 +44,7 @@ - SM83: Emulate HALT bug
Other fixes: - 3DS: Redo video sync to be more precise - 3DS: Fix crash with libctru 2.0 when exiting + - 3DS: Fix thread cleanup - All: Improve export headers (fixes mgba.io/i/1738) - Core: Ensure ELF regions can be written before trying - Core: Fix reported ROM size when a fixed buffer size is used
M
include/mgba-util/platform/3ds/threading.h
→
include/mgba-util/platform/3ds/threading.h
@@ -69,12 +69,14 @@ static inline int ThreadCreate(Thread* thread, ThreadEntry entry, void* context) {
if (!entry || !thread) { return 1; } - *thread = threadCreate(entry, context, 0x8000, 0x18, 2, true); + *thread = threadCreate(entry, context, 0x8000, 0x18, 2, false); return !*thread; } static inline int ThreadJoin(Thread* thread) { - return threadJoin(*thread, U64_MAX); + Result res = threadJoin(*thread, U64_MAX); + threadFree(*thread); + return res; } static inline void ThreadSetName(const char* name) {
M
src/feature/thread-proxy.c
→
src/feature/thread-proxy.c
@@ -206,10 +206,6 @@ proxyRenderer->threadState = PROXY_THREAD_IDLE;
} } MutexUnlock(&proxyRenderer->mutex); - -#ifdef _3DS - svcExitThread(); -#endif return 0; }