mirror of https://github.com/mgba-emu/mgba.git
mGUI: Fix crash if last loaded ROM directory disappears (fixes #1466)
This commit is contained in:
parent
51e7070302
commit
ba547b26d1
1
CHANGES
1
CHANGES
|
@ -39,6 +39,7 @@ Other fixes:
|
|||
- 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
|
||||
|
|
|
@ -212,8 +212,12 @@ void mGUIInit(struct mGUIRunner* runner, const char* port) {
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue