diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index bf6120b8f..646d03231 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -949,6 +949,8 @@ int NDS_LoadROM(const char *filename, const char *logicalFilename) #endif void NDS_FreeROM(void) { + if ((u8*)MMU.CART_ROM == (u8*)gameInfo.romdata) + gameInfo.romdata = NULL; if (MMU.CART_ROM != MMU.UNUSED_RAM) delete [] MMU.CART_ROM; MMU_unsetRom();