GB: Properly unload save files when unloading a ROM
Jeffrey Pfau jeffrey@endrift.com
Wed, 05 Oct 2016 00:01:11 -0700
2 files changed,
6 insertions(+),
3 deletions(-)
M
CHANGES
→
CHANGES
@@ -29,6 +29,7 @@ - GBA Cheats: Fix uninitialized memory getting freed when saving
- 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
M
src/gb/gb.c
→
src/gb/gb.c
@@ -253,11 +253,13 @@ gb->romVf = 0;
} 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) {