GBA: Fix freeing the right things when unloading a ROM

This commit is contained in:
Jeffrey Pfau 2015-06-20 16:18:06 -07:00
parent ef93f68658
commit 4388e36ddc

View File

@ -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) {