summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-06-29 01:58:40 +0200
committerbunnei <bunneidev@gmail.com>2021-07-21 03:54:55 +0200
commit6020723e77585835eddcc5675385f5e7dd3072ac (patch)
treef86848fcd58058caa6c5e00ee03c3f94c3a06f73 /src
parenthle: kernel: Ensure global handle table is initialized. (diff)
downloadyuzu-6020723e77585835eddcc5675385f5e7dd3072ac.tar
yuzu-6020723e77585835eddcc5675385f5e7dd3072ac.tar.gz
yuzu-6020723e77585835eddcc5675385f5e7dd3072ac.tar.bz2
yuzu-6020723e77585835eddcc5675385f5e7dd3072ac.tar.lz
yuzu-6020723e77585835eddcc5675385f5e7dd3072ac.tar.xz
yuzu-6020723e77585835eddcc5675385f5e7dd3072ac.tar.zst
yuzu-6020723e77585835eddcc5675385f5e7dd3072ac.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/k_process.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/hle/kernel/k_process.cpp b/src/core/hle/kernel/k_process.cpp
index d1bd98051..c309ae563 100644
--- a/src/core/hle/kernel/k_process.cpp
+++ b/src/core/hle/kernel/k_process.cpp
@@ -10,6 +10,7 @@
#include "common/alignment.h"
#include "common/assert.h"
#include "common/logging/log.h"
+#include "common/scope_exit.h"
#include "common/settings.h"
#include "core/core.h"
#include "core/device_memory.h"
@@ -43,6 +44,8 @@ void SetupMainThread(Core::System& system, KProcess& owner_process, u32 priority
ASSERT(owner_process.GetResourceLimit()->Reserve(LimitableResource::Threads, 1));
KThread* thread = KThread::Create(system.Kernel());
+ SCOPE_EXIT({ thread->Close(); });
+
ASSERT(KThread::InitializeUserThread(system, thread, entry_point, 0, stack_top, priority,
owner_process.GetIdealCoreId(), &owner_process)
.IsSuccess());