diff options
| author | liamwhite <liamwhite@users.noreply.github.com> | 2024-02-19 10:50:45 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-19 10:50:45 -0500 |
| commit | 7af190af17e607a3f9ed597112fe4583abaab58a (patch) | |
| tree | 43a5699123e4930560fc5016faac7efb15b63f4e /src/core/hle/kernel/k_process.cpp | |
| parent | 984329e0e67106a5d2124d38e10052131a89e7b7 (diff) | |
| parent | 4d55e58ee4d99fbd7a2d6973f21b9c0e61c0f137 (diff) | |
Merge pull request #13080 from FearlessTobi/scope-exit
scope_exit: Make constexpr
Diffstat (limited to 'src/core/hle/kernel/k_process.cpp')
| -rw-r--r-- | src/core/hle/kernel/k_process.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/core/hle/kernel/k_process.cpp b/src/core/hle/kernel/k_process.cpp index 1bcc428907..cb9a11a631 100644 --- a/src/core/hle/kernel/k_process.cpp +++ b/src/core/hle/kernel/k_process.cpp @@ -77,7 +77,9 @@ Result TerminateChildren(KernelCore& kernel, KProcess* process, } // Terminate and close the thread. - SCOPE_EXIT({ cur_child->Close(); }); + SCOPE_EXIT { + cur_child->Close(); + }; if (const Result terminate_result = cur_child->Terminate(); ResultTerminationRequested == terminate_result) { @@ -466,11 +468,11 @@ void KProcess::DoWorkerTaskImpl() { Result KProcess::StartTermination() { // Finalize the handle table when we're done, if the process isn't immortal. - SCOPE_EXIT({ + SCOPE_EXIT { if (!m_is_immortal) { this->FinalizeHandleTable(); } - }); + }; // Terminate child threads other than the current one. R_RETURN(TerminateChildren(m_kernel, this, GetCurrentThreadPointer(m_kernel))); @@ -964,7 +966,9 @@ Result KProcess::Run(s32 priority, size_t stack_size) { // Create a new thread for the process. KThread* main_thread = KThread::Create(m_kernel); R_UNLESS(main_thread != nullptr, ResultOutOfResource); - SCOPE_EXIT({ main_thread->Close(); }); + SCOPE_EXIT { + main_thread->Close(); + }; // Initialize the thread. R_TRY(KThread::InitializeUserThread(m_kernel.System(), main_thread, this->GetEntryPoint(), 0, @@ -1155,7 +1159,9 @@ Result KProcess::LoadFromMetadata(const FileSys::ProgramMetadata& metadata, std: Kernel::CreateResourceLimitForProcess(m_kernel.System(), physical_memory_size); // Ensure we maintain a clean state on exit. - SCOPE_EXIT({ res_limit->Close(); }); + SCOPE_EXIT { + res_limit->Close(); + }; // Declare flags and code address. Svc::CreateProcessFlag flag{}; |
