summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-12-12 23:37:42 +0100
committerGitHub <noreply@github.com>2022-12-12 23:37:42 +0100
commit339a37f8cb19dffbf64015b5d9a362a1ef5560c2 (patch)
tree0742ac869b92b4ee7b2c49ef77547cdaeac5038d /src/core/hle
parentMerge pull request #9406 from vonchenplus/topology (diff)
parentgeneral: improve handling of system startup failure (diff)
downloadyuzu-339a37f8cb19dffbf64015b5d9a362a1ef5560c2.tar
yuzu-339a37f8cb19dffbf64015b5d9a362a1ef5560c2.tar.gz
yuzu-339a37f8cb19dffbf64015b5d9a362a1ef5560c2.tar.bz2
yuzu-339a37f8cb19dffbf64015b5d9a362a1ef5560c2.tar.lz
yuzu-339a37f8cb19dffbf64015b5d9a362a1ef5560c2.tar.xz
yuzu-339a37f8cb19dffbf64015b5d9a362a1ef5560c2.tar.zst
yuzu-339a37f8cb19dffbf64015b5d9a362a1ef5560c2.zip
Diffstat (limited to 'src/core/hle')
-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 {
}
void CloseCurrentProcess() {
- (*current_process).Finalize();
- // current_process->Close();
- // TODO: The current process should be destroyed based on accurate ref counting after
+ KProcess* old_process = current_process.exchange(nullptr);
+ if (old_process == nullptr) {
+ return;
+ }
+
+ // old_process->Close();
+ // TODO: The 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;
+ old_process->Finalize();
+ old_process->Destroy();
}
void Shutdown() {