diff options
| author | 2021-06-28 16:58:40 -0700 | |
|---|---|---|
| committer | 2021-07-20 18:54:55 -0700 | |
| commit | 6020723e77585835eddcc5675385f5e7dd3072ac (patch) | |
| tree | f86848fcd58058caa6c5e00ee03c3f94c3a06f73 /src/core | |
| parent | hle: kernel: Ensure global handle table is initialized. (diff) | |
| download | yuzu-6020723e77585835eddcc5675385f5e7dd3072ac.tar.gz yuzu-6020723e77585835eddcc5675385f5e7dd3072ac.tar.xz yuzu-6020723e77585835eddcc5675385f5e7dd3072ac.zip | |
hle: kernel: k_process: Close main thread reference after it is inserted into handle table.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/kernel/k_process.cpp | 3 |
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 @@ | |||
| 10 | #include "common/alignment.h" | 10 | #include "common/alignment.h" |
| 11 | #include "common/assert.h" | 11 | #include "common/assert.h" |
| 12 | #include "common/logging/log.h" | 12 | #include "common/logging/log.h" |
| 13 | #include "common/scope_exit.h" | ||
| 13 | #include "common/settings.h" | 14 | #include "common/settings.h" |
| 14 | #include "core/core.h" | 15 | #include "core/core.h" |
| 15 | #include "core/device_memory.h" | 16 | #include "core/device_memory.h" |
| @@ -43,6 +44,8 @@ void SetupMainThread(Core::System& system, KProcess& owner_process, u32 priority | |||
| 43 | ASSERT(owner_process.GetResourceLimit()->Reserve(LimitableResource::Threads, 1)); | 44 | ASSERT(owner_process.GetResourceLimit()->Reserve(LimitableResource::Threads, 1)); |
| 44 | 45 | ||
| 45 | KThread* thread = KThread::Create(system.Kernel()); | 46 | KThread* thread = KThread::Create(system.Kernel()); |
| 47 | SCOPE_EXIT({ thread->Close(); }); | ||
| 48 | |||
| 46 | ASSERT(KThread::InitializeUserThread(system, thread, entry_point, 0, stack_top, priority, | 49 | ASSERT(KThread::InitializeUserThread(system, thread, entry_point, 0, stack_top, priority, |
| 47 | owner_process.GetIdealCoreId(), &owner_process) | 50 | owner_process.GetIdealCoreId(), &owner_process) |
| 48 | .IsSuccess()); | 51 | .IsSuccess()); |