From 0a18c63f245d2dbf38cd966e6f40ef20396ae41f Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Fri, 13 Dec 2019 13:35:33 -0800 Subject: [PATCH] pm: fix process exit on < 5.0.0 (closes #748) (thanks @misson20000) --- stratosphere/pm/source/impl/pm_process_manager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stratosphere/pm/source/impl/pm_process_manager.cpp b/stratosphere/pm/source/impl/pm_process_manager.cpp index fecb1236a..c732b72bf 100644 --- a/stratosphere/pm/source/impl/pm_process_manager.cpp +++ b/stratosphere/pm/source/impl/pm_process_manager.cpp @@ -412,12 +412,12 @@ namespace ams::pm::impl { } break; case ProcessState_Exited: + /* Free process resources, unlink from waitable manager. */ + process_info->Cleanup(); + if (hos::GetVersion() < hos::Version_500 && process_info->ShouldSignalOnExit()) { g_process_event.Signal(); } else { - /* Free process resources, unlink from waitable manager. */ - process_info->Cleanup(); - /* Handle the case where we need to keep the process alive some time longer. */ if (hos::GetVersion() >= hos::Version_500 && process_info->ShouldSignalOnExit()) { /* Remove from the living list. */ @@ -436,6 +436,7 @@ namespace ams::pm::impl { CleanupProcessInfo(list, process_info); } } + break; case ProcessState_DebugSuspended: if (process_info->ShouldSignalOnDebugEvent()) { process_info->SetSuspended();