From 051198395dc108415035ac37f779e9f063b6d2eb Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Tue, 9 Aug 2016 23:35:38 -0700 Subject: [PATCH] PSP2: Delete threads after they return --- CHANGES | 1 + src/platform/psp2/threading.h | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 8901934e6..e14ec7bcb 100644 --- a/CHANGES +++ b/CHANGES @@ -21,6 +21,7 @@ Bugfixes: - Wii: Fix framelimiting after a slowdown - PSP2: Fix gyroscope direction - Qt: Fix hanging key press after disabling autofire + - PSP2: Delete threads after they return Misc: - 3DS: Use blip_add_delta_fast for a small speed improvement - OpenGL: Log shader compilation failure diff --git a/src/platform/psp2/threading.h b/src/platform/psp2/threading.h index 54fdcb243..07388bed8 100644 --- a/src/platform/psp2/threading.h +++ b/src/platform/psp2/threading.h @@ -132,7 +132,11 @@ static inline int ThreadCreate(Thread* thread, ThreadEntry entry, void* context) } static inline int ThreadJoin(Thread thread) { - return sceKernelWaitThreadEnd(thread, 0, 0); + int res = sceKernelWaitThreadEnd(thread, 0, 0); + if (res < 0) { + return res; + } + return sceKernelDeleteThread(thread); } static inline int ThreadSetName(const char* name) {