From 87a167983e6d8d14dcc6145a9e836323e6580f45 Mon Sep 17 00:00:00 2001 From: nitsuja Date: Sun, 6 Sep 2009 16:41:18 +0000 Subject: [PATCH] crash fix for win32 closerom --- desmume/src/NDSSystem.cpp | 2 ++ 1 file changed, 2 insertions(+) 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();