From 8c107d78a3fe99465c6df7718c5b94fe8ee7cb47 Mon Sep 17 00:00:00 2001 From: Maschell Date: Mon, 14 Feb 2022 19:18:43 +0100 Subject: [PATCH] Unmount the romfs on file reading error --- src/FileWrapper.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/FileWrapper.cpp b/src/FileWrapper.cpp index 4df2a35..ec8cfa7 100644 --- a/src/FileWrapper.cpp +++ b/src/FileWrapper.cpp @@ -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;