diff options
| author | 2022-12-06 16:13:42 -0500 | |
|---|---|---|
| committer | 2022-12-06 16:13:42 -0500 | |
| commit | 9704acb982eb3dfb4b2b6a090f5613d4ac57b196 (patch) | |
| tree | ffc2dd5818b94e61e09eed5388cb821c90dc0896 /src/core/hle/kernel/kernel.cpp | |
| parent | Merge pull request #9393 from liamwhite/more-vulkan (diff) | |
| download | yuzu-9704acb982eb3dfb4b2b6a090f5613d4ac57b196.tar.gz yuzu-9704acb982eb3dfb4b2b6a090f5613d4ac57b196.tar.xz yuzu-9704acb982eb3dfb4b2b6a090f5613d4ac57b196.zip | |
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 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() { |