diff options
| author | bunnei <bunneidev@gmail.com> | 2022-12-12 14:37:42 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-12 14:37:42 -0800 |
| commit | a0fa54b0169854bd39f014899361a563e70c589d (patch) | |
| tree | 0742ac869b92b4ee7b2c49ef77547cdaeac5038d /src/core/hle/kernel/kernel.cpp | |
| parent | d6c387db4404585004d8ec1db77a8c4b5b742b97 (diff) | |
| parent | 08d81c9726eeec0f1338bc19299d7b6c24dcadce (diff) | |
Merge pull request #9398 from liamwhite/fail
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() { |
