From dd29285e356838b2326f1d2261f0a97eeded713e Mon Sep 17 00:00:00 2001 From: Feng Chen Date: Tue, 26 Oct 2021 18:12:13 +0800 Subject: Fix dangling kernel objects when exiting --- src/core/hle/kernel/kernel.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/core/hle/kernel/kernel.cpp') diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index db9f55864..4a139c5e7 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -91,12 +91,6 @@ struct KernelCore::Impl { } void Shutdown() { - // Shutdown all processes. - if (current_process) { - current_process->Finalize(); - current_process->Close(); - current_process = nullptr; - } process_list.clear(); // Close all open server ports. @@ -181,6 +175,13 @@ struct KernelCore::Impl { } } + // Shutdown all processes. + if (current_process) { + current_process->Finalize(); + current_process->Close(); + current_process = nullptr; + } + // Track kernel objects that were not freed on shutdown { std::lock_guard lk(registered_objects_lock); -- cgit v1.2.3