From 05ef022fd72357bc72750a0c6529eacba74e76fd Mon Sep 17 00:00:00 2001 From: Silent Date: Fri, 15 Nov 2019 23:05:48 +0100 Subject: [PATCH] [Kernel] Do not retain handle in ExCreateThread Closing the thread handle should delete the thread object if it's finished. When this handle was retained, closing the handle left a lingering handle reference and thus this XThread would leak --- src/xenia/kernel/xboxkrnl/xboxkrnl_threading.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_threading.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_threading.cc index c601b51da..4800f0455 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_threading.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_threading.cc @@ -138,7 +138,6 @@ dword_result_t ExCreateThread(lpdword_t handle_ptr, dword_t stack_size, if (creation_flags & 0x80) { *handle_ptr = thread->guest_object(); } else { - thread->RetainHandle(); *handle_ptr = thread->handle(); } }