Unmount the romfs on file reading error

This commit is contained in:
Maschell 2022-02-14 19:18:43 +01:00
parent d2c53b77af
commit 8c107d78a3

View File

@ -53,6 +53,7 @@ int OpenFileForID(int id, const char *filepath, int *handle) {
if (handle_wrapper_slot < 0) {
DEBUG_FUNCTION_LINE("No free slot");
RL_FileClose(out_handle);
unmountRomfs(id);
return -2;
}
gFileHandleWrapper[handle_wrapper_slot].handle = out_handle;