all repos — mgba @ bf06f1e4439ddbe75828a1515aa723bb7c6d978e

mGBA Game Boy Advance Emulator

GB: Properly unload save files when unloading a ROM
Jeffrey Pfau jeffrey@endrift.com
Wed, 05 Oct 2016 00:01:11 -0700
commit

bf06f1e4439ddbe75828a1515aa723bb7c6d978e

parent

742538dc432a3d85b66318eded435a73dfce0f5c

2 files changed, 6 insertions(+), 3 deletions(-)

jump to
M CHANGESCHANGES

@@ -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.csrc/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) {