summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r--src/core/hle/kernel/kernel.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 288f97df5..0eb74a422 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -104,12 +104,16 @@ struct KernelCore::Impl {
104 } 104 }
105 105
106 void CloseCurrentProcess() { 106 void CloseCurrentProcess() {
107 (*current_process).Finalize(); 107 KProcess* old_process = current_process.exchange(nullptr);
108 // current_process->Close(); 108 if (old_process == nullptr) {
109 // TODO: The current process should be destroyed based on accurate ref counting after 109 return;
110 }
111
112 // old_process->Close();
113 // TODO: The process should be destroyed based on accurate ref counting after
110 // calling Close(). Adding a manual Destroy() call instead to avoid a memory leak. 114 // calling Close(). Adding a manual Destroy() call instead to avoid a memory leak.
111 (*current_process).Destroy(); 115 old_process->Finalize();
112 current_process = nullptr; 116 old_process->Destroy();
113 } 117 }
114 118
115 void Shutdown() { 119 void Shutdown() {