From fffe25e00b9d2127df28ea83032c840a60e67e0f Mon Sep 17 00:00:00 2001 From: Maschell Date: Mon, 14 Feb 2022 20:54:54 +0100 Subject: [PATCH] Fix .wuhb loading when more than .wuhb is on the sd card --- src/FileWrapper.cpp | 1 + src/main.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/FileWrapper.cpp b/src/FileWrapper.cpp index 78eff28..04ad28f 100644 --- a/src/FileWrapper.cpp +++ b/src/FileWrapper.cpp @@ -19,6 +19,7 @@ int FileHandleWrapper_GetSlot() { if (!gFileHandleWrapper[i].inUse) { gFileHandleWrapper[i].inUse = true; res = i; + break; } } OSMemoryBarrier(); diff --git a/src/main.cpp b/src/main.cpp index 9c851ea..07b7841 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -52,6 +52,7 @@ INITIALIZE_PLUGIN() { memset((void *) ¤t_launched_title_info, 0, sizeof(current_launched_title_info)); memset((void *) &gLaunchXML, 0, sizeof(gLaunchXML)); memset((void *) &gFileInfos, 0, sizeof(gFileInfos)); + memset((void *) &gFileHandleWrapper, 0, sizeof(gFileHandleWrapper)); gHomebrewLaunched = FALSE; OSInitMutex(&fileWrapperMutex); OSInitMutex(&fileinfoMutex);