From 1d8b793cf760887c9519dd0ebdff5c95b928d2aa Mon Sep 17 00:00:00 2001 From: TuxSH Date: Sun, 26 Apr 2020 20:55:52 +0100 Subject: [PATCH] rosalina: don't keep an ac:u handle. Partially fixes the shutdown issue --- sysmodules/rosalina/source/main.c | 6 +++--- sysmodules/rosalina/source/menus/sysconfig.c | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sysmodules/rosalina/source/main.c b/sysmodules/rosalina/source/main.c index 5e88cbe..77234a7 100644 --- a/sysmodules/rosalina/source/main.c +++ b/sysmodules/rosalina/source/main.c @@ -91,7 +91,7 @@ void exit(int rc) __libc_fini_array(); // Kernel will take care of it all - /*acExit(); + /* pmDbgExit(); fsExit(); svcCloseHandle(*fsRegGetSessionHandle()); @@ -134,8 +134,8 @@ void initSystem(void) if (R_FAILED(pmDbgInit())) svcBreak(USERBREAK_PANIC); - if (R_FAILED(acInit())) - svcBreak(USERBREAK_PANIC); + // **** DO NOT init services that don't come from KIPs here **** + // Instead, init the service only where it's actually init (then deinit it). __libc_init_array(); diff --git a/sysmodules/rosalina/source/menus/sysconfig.c b/sysmodules/rosalina/source/menus/sysconfig.c index d7fac2a..c0e32b7 100644 --- a/sysmodules/rosalina/source/menus/sysconfig.c +++ b/sysmodules/rosalina/source/menus/sysconfig.c @@ -153,6 +153,8 @@ static void SysConfigMenu_ForceWifiConnection(int slot) { char ssid[0x20 + 1] = {0}; + acInit(); + acuConfig config = {0}; ACU_CreateDefaultConfig(&config); ACU_SetNetworkArea(&config, 2); @@ -173,6 +175,8 @@ static void SysConfigMenu_ForceWifiConnection(int slot) } svcCloseHandle(connectEvent); + acExit(); + char infoString[80] = {0}; u32 infoStringColor = forcedConnection ? COLOR_GREEN : COLOR_RED; if(forcedConnection)