diff options
| author | 2022-12-12 14:37:42 -0800 | |
|---|---|---|
| committer | 2022-12-12 14:37:42 -0800 | |
| commit | 339a37f8cb19dffbf64015b5d9a362a1ef5560c2 (patch) | |
| tree | 0742ac869b92b4ee7b2c49ef77547cdaeac5038d /src/core/hle/kernel/kernel.cpp | |
| parent | Merge pull request #9406 from vonchenplus/topology (diff) | |
| parent | general: improve handling of system startup failure (diff) | |
| download | yuzu-339a37f8cb19dffbf64015b5d9a362a1ef5560c2.tar.gz yuzu-339a37f8cb19dffbf64015b5d9a362a1ef5560c2.tar.xz yuzu-339a37f8cb19dffbf64015b5d9a362a1ef5560c2.zip | |
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 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() { |