diff --git a/desmume/src/addons/slot2_mpcf.cpp b/desmume/src/addons/slot2_mpcf.cpp index f5c5777fc..7fb3e03be 100644 --- a/desmume/src/addons/slot2_mpcf.cpp +++ b/desmume/src/addons/slot2_mpcf.cpp @@ -64,7 +64,7 @@ static u32 fileStartLBA,fileEndLBA; static std::string sFlashPath; static BOOL cflashDeviceEnabled = FALSE; -static EMUFILE* file; +static EMUFILE* file = NULL; // =========================== BOOL inited; @@ -259,16 +259,9 @@ static void cflash_write(unsigned int address,unsigned int data) static void cflash_close( void) { if (!inited) return; - if (!CFlash_IsUsingPath()) - { - delete file; - file = NULL; - } - else - { - int i; - cflashDeviceEnabled = FALSE; - } + if(file) delete file; + cflashDeviceEnabled = FALSE; + file = NULL; inited = FALSE; }