GB: Properly unload save files when unloading a ROM

This commit is contained in:
Jeffrey Pfau 2016-10-05 00:01:11 -07:00
parent 742538dc43
commit bf06f1e443
2 changed files with 6 additions and 3 deletions

View File

@ -29,6 +29,7 @@ Bugfixes:
- GBA Memory: Fix several unused I/O register read values
- Qt: Fix patch loading
- Qt: Fix crash when saving an override if a game isn't loaded
- GB: Properly unload save files when unloading a ROM
Misc:
- All: Only update version info if needed
- FFmpeg: Encoding cleanup

View File

@ -253,11 +253,13 @@ void GBUnloadROM(struct GB* gb) {
}
gb->pristineRom = 0;
struct VFile* vf = gb->sramVf;
GBSavedataUnmask(gb);
GBSramDeinit(gb);
if (vf) {
vf->close(vf);
if (gb->sramRealVf) {
gb->sramRealVf->close(gb->sramRealVf);
}
gb->sramRealVf = NULL;
gb->sramVf = NULL;
}
void GBLoadBIOS(struct GB* gb, struct VFile* vf) {