diff options
author | bunnei <bunneidev@gmail.com> | 2022-10-02 23:26:30 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2022-10-19 04:13:35 +0200 |
commit | abcc009dff5d98b5a04229f3a82baab23d568244 (patch) | |
tree | e51f99cf493425a3cd331ffdaa1b984554e429aa /src/core/hle/kernel/kernel.cpp | |
parent | core: hle: kernel: k_interrupt_manager: HandleInterrupt should not depend on current process. (diff) | |
download | yuzu-abcc009dff5d98b5a04229f3a82baab23d568244.tar yuzu-abcc009dff5d98b5a04229f3a82baab23d568244.tar.gz yuzu-abcc009dff5d98b5a04229f3a82baab23d568244.tar.bz2 yuzu-abcc009dff5d98b5a04229f3a82baab23d568244.tar.lz yuzu-abcc009dff5d98b5a04229f3a82baab23d568244.tar.xz yuzu-abcc009dff5d98b5a04229f3a82baab23d568244.tar.zst yuzu-abcc009dff5d98b5a04229f3a82baab23d568244.zip |
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r-- | src/core/hle/kernel/kernel.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index b6bbd4984..6879de9ef 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -95,6 +95,15 @@ struct KernelCore::Impl { } } + void CloseCurrentProcess() { + (*current_process).Finalize(); + // current_process->Close(); + // TODO: The current process should be destroyed based on accurate ref counting after + // calling Close(). Adding a manual Destroy() call instead to avoid a memory leak. + (*current_process).Destroy(); + current_process = nullptr; + } + void Shutdown() { is_shutting_down.store(true, std::memory_order_relaxed); SCOPE_EXIT({ is_shutting_down.store(false, std::memory_order_relaxed); }); @@ -157,15 +166,7 @@ struct KernelCore::Impl { } } - // Shutdown all processes. - if (current_process) { - (*current_process).Finalize(); - // current_process->Close(); - // TODO: The current process should be destroyed based on accurate ref counting after - // calling Close(). Adding a manual Destroy() call instead to avoid a memory leak. - (*current_process).Destroy(); - current_process = nullptr; - } + CloseCurrentProcess(); // Track kernel objects that were not freed on shutdown { @@ -870,6 +871,10 @@ const KProcess* KernelCore::CurrentProcess() const { return impl->current_process; } +void KernelCore::CloseCurrentProcess() { + impl->CloseCurrentProcess(); +} + const std::vector<KProcess*>& KernelCore::GetProcessList() const { return impl->process_list; } |