GBA: Fix freeing the right things when unloading a ROM
Jeffrey Pfau jeffrey@endrift.com
Sat, 20 Jun 2015 16:18:06 -0700
1 files changed,
4 insertions(+),
1 deletions(-)
jump to
M
src/gba/gba.c
→
src/gba/gba.c
@@ -100,7 +100,10 @@ void GBAUnloadROM(struct GBA* gba) {
if (gba->pristineRom == gba->memory.rom) { gba->memory.rom = 0; } else { - mappedMemoryFree(gba->pristineRom, gba->pristineRomSize); + if (gba->yankedRomSize) { + gba->yankedRomSize = 0; + } + mappedMemoryFree(gba->memory.rom, SIZE_CART0); } if (gba->romVf) {