diff options
| author | bunnei <bunneidev@gmail.com> | 2021-07-23 21:23:56 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-23 21:23:56 -0400 |
| commit | 2656020608e32f1f0120dead047b61302bcb4461 (patch) | |
| tree | 0f4b89d1e51ceb1232eec020d0fe22c7d8b7f930 /src/core/hle/kernel/k_process.cpp | |
| parent | db46f8a70c853ccab3318abed1416231a3c426db (diff) | |
| parent | 346bfb6c47096239e1997e348c76aeadbe05294d (diff) | |
Merge pull request #6551 from bunnei/improve-kernel-obj
Improve management of kernel objects
Diffstat (limited to 'src/core/hle/kernel/k_process.cpp')
| -rw-r--r-- | src/core/hle/kernel/k_process.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/hle/kernel/k_process.cpp b/src/core/hle/kernel/k_process.cpp index d1bd98051..8ead1a769 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()); @@ -162,7 +165,7 @@ void KProcess::DecrementThreadCount() { ASSERT(num_threads > 0); if (const auto count = --num_threads; count == 0) { - UNIMPLEMENTED_MSG("Process termination is not implemented!"); + LOG_WARNING(Kernel, "Process termination is not fully implemented."); } } @@ -406,6 +409,9 @@ void KProcess::Finalize() { resource_limit->Close(); } + // Finalize the handle table and close any open handles. + handle_table.Finalize(); + // Perform inherited finalization. KAutoObjectWithSlabHeapAndContainer<KProcess, KSynchronizationObject>::Finalize(); } |
