diff --git a/Dockerfile b/Dockerfile index 74d8ddd..e89c2a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM wiiuenv/devkitppc:20220806 +FROM wiiuenv/devkitppc:20220917 COPY --from=wiiuenv/libfunctionpatcher:20220904 /artifacts $DEVKITPRO -COPY --from=wiiuenv/wiiumodulesystem:20220904 /artifacts $DEVKITPRO +COPY --from=wiiuenv/wiiumodulesystem:20221005 /artifacts $DEVKITPRO WORKDIR project diff --git a/source/sdrefcount/sd_function_replacements.cpp b/source/sdrefcount/sd_function_replacements.cpp index 99bf8b1..29c021d 100644 --- a/source/sdrefcount/sd_function_replacements.cpp +++ b/source/sdrefcount/sd_function_replacements.cpp @@ -2,6 +2,7 @@ #include "applicationendshook/applicationends_function_replacements.h" #include "globals.h" #include "logger.h" +#include #include #include @@ -17,6 +18,14 @@ DECL_FUNCTION(void, __PPCExit, uint32_t u1) { } gSDMountRefCount = 0; } + + if (gModuleData->number_acquired_rpls > 0) { + DEBUG_FUNCTION_LINE_VERBOSE("Release RPLs acquired by modules"); + for (uint32_t i = 0; i < gModuleData->number_acquired_rpls; i++) { + DEBUG_FUNCTION_LINE_VERBOSE("OSDynLoad_Release(0x%08)", gModuleData->acquired_rpls[i]); + OSDynLoad_Release((void *) gModuleData->acquired_rpls[i]); + } + } real___PPCExit(u1); }