fix memory leak in slot2 mpcf

This commit is contained in:
zeromus 2011-03-21 02:52:16 +00:00
parent d77e3ee425
commit 972d9e28ea
1 changed files with 4 additions and 11 deletions

View File

@ -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;
}