Call OSDynLoad_Release for RPLs acquired by aroma modules on exit

This commit is contained in:
Maschell 2022-10-05 15:53:35 +02:00
parent fa6c26e26c
commit 5d6324dc6d
2 changed files with 11 additions and 2 deletions

View File

@ -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

View File

@ -2,6 +2,7 @@
#include "applicationendshook/applicationends_function_replacements.h"
#include "globals.h"
#include "logger.h"
#include <coreinit/dynload.h>
#include <coreinit/filesystem_fsa.h>
#include <string_view>
@ -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);
}