all repos — mgba @ ba547b26d1c645b6f62739f01d7194794cca6949

mGBA Game Boy Advance Emulator

mGUI: Fix crash if last loaded ROM directory disappears (fixes #1466)
Vicki Pfau vi@endrift.com
Mon, 24 Jun 2019 13:15:37 -0700
commit

ba547b26d1c645b6f62739f01d7194794cca6949

parent

51e70703023773fbe37a527c13c3df9f9fc05c69

2 files changed, 7 insertions(+), 2 deletions(-)

jump to
M CHANGESCHANGES

@@ -39,6 +39,7 @@ - Qt: Fix menu bar staying hidden in full screen (fixes mgba.io/i/317)

- GB SIO: Fix lockstep failing games aren't reloaded - Core: Fix crash when exiting game with cheats loaded - GBA Cheats: Fix PARv3 Thumb hooks + - mGUI: Fix crash if last loaded ROM directory disappears (fixes mgba.io/i/1466) Misc: - GBA Savedata: EEPROM performance fixes - GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash
M src/feature/gui/gui-runner.csrc/feature/gui/gui-runner.c

@@ -212,8 +212,12 @@ mLogSetDefaultLogger(&logger.d);

const char* lastPath = mCoreConfigGetValue(&runner->config, "lastDirectory"); if (lastPath) { - strncpy(runner->params.currentPath, lastPath, PATH_MAX - 1); - runner->params.currentPath[PATH_MAX - 1] = '\0'; + struct VDir* dir = VDirOpen(lastPath); + if (dir) { + dir->close(dir); + strncpy(runner->params.currentPath, lastPath, PATH_MAX - 1); + runner->params.currentPath[PATH_MAX - 1] = '\0'; + } } #ifndef DISABLE_THREADING