all repos — mgba @ 4388e36ddcd63269f1f652ff9897d694a91efb7a

mGBA Game Boy Advance Emulator

GBA: Fix freeing the right things when unloading a ROM
Jeffrey Pfau jeffrey@endrift.com
Sat, 20 Jun 2015 16:18:06 -0700
commit

4388e36ddcd63269f1f652ff9897d694a91efb7a

parent

ef93f686580686e35044a0f620c37f3ddf850d18

1 files changed, 4 insertions(+), 1 deletions(-)

jump to
M src/gba/gba.csrc/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) {