diff options
| author | Liam <byteslice@airmail.cc> | 2022-12-06 16:13:42 -0500 |
|---|---|---|
| committer | Liam <byteslice@airmail.cc> | 2022-12-06 16:13:42 -0500 |
| commit | 08d81c9726eeec0f1338bc19299d7b6c24dcadce (patch) | |
| tree | ffc2dd5818b94e61e09eed5388cb821c90dc0896 /src/core/hle/kernel/kernel.cpp | |
| parent | 7ca1fcfcce655ef556f3e0e95f58820df8a5b4b5 (diff) | |
general: improve handling of system startup failure
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 288f97df50..0eb74a422b 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() { |
