diff --git a/troposphere/haze/source/main.cpp b/troposphere/haze/source/main.cpp index 1cab75b9b..cfdf240ee 100644 --- a/troposphere/haze/source/main.cpp +++ b/troposphere/haze/source/main.cpp @@ -17,6 +17,9 @@ #include int main(int argc, char **argv) { + /* Lock exit so that cleanup is ensured. */ + HAZE_R_ABORT_UNLESS(appletLockExit()); + /* Load device firmware version and serial number. */ HAZE_R_ABORT_UNLESS(haze::LoadDeviceProperties()); @@ -24,5 +27,6 @@ int main(int argc, char **argv) { haze::ConsoleMainLoop::RunApplication(); /* Return to the loader. */ + appletUnlockExit(); return 0; } diff --git a/troposphere/reboot_to_payload/source/main.c b/troposphere/reboot_to_payload/source/main.c index ebae553ea..4e4e9504a 100644 --- a/troposphere/reboot_to_payload/source/main.c +++ b/troposphere/reboot_to_payload/source/main.c @@ -8,11 +8,17 @@ #define IRAM_PAYLOAD_MAX_SIZE 0x24000 static u8 g_reboot_payload[IRAM_PAYLOAD_MAX_SIZE]; +void userAppInit(void) +{ + appletLockExit(); +} + void userAppExit(void) { amsBpcExit(); setsysExit(); spsmExit(); + appletUnlockExit(); } static void reboot_to_payload(void) {