From 9fac0a0ea11f50e904f682310f589e9fd244f7e6 Mon Sep 17 00:00:00 2001 From: smea Date: Tue, 7 Jul 2015 19:52:18 -0700 Subject: [PATCH] socMemhandle should be closed even if shutdown command fails --- libctru/source/services/soc/soc_init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libctru/source/services/soc/soc_init.c b/libctru/source/services/soc/soc_init.c index 9f5a88f..a1b081b 100644 --- a/libctru/source/services/soc/soc_init.c +++ b/libctru/source/services/soc/soc_init.c @@ -98,6 +98,8 @@ Result SOC_Shutdown(void) Result ret = 0; u32 *cmdbuf = getThreadCommandBuffer(); int dev; + + svcCloseHandle(socMemhandle); cmdbuf[0] = 0x00190000; @@ -108,7 +110,6 @@ Result SOC_Shutdown(void) } svcCloseHandle(SOCU_handle); - svcCloseHandle(socMemhandle); dev = FindDevice("soc:"); if(dev >= 0)