Fixed memory leak. And added braces to match the rest of the switch statement in FileIO.
This commit is contained in:
parent
d6d52920ec
commit
418f46ea72
|
@ -390,7 +390,13 @@ void ExecuteCommand(u32 _Address)
|
|||
INFO_LOG(WII_IPC_FILEIO, "IOP: Open File (Device=%s, ID=%08x, Mode=%i)",
|
||||
pDevice->GetDeviceName().c_str(), DeviceID, Mode);
|
||||
if (Memory::Read_U32(_Address + 4) == DeviceID)
|
||||
{
|
||||
g_FdMap[DeviceID] = pDevice;
|
||||
}
|
||||
else
|
||||
{
|
||||
delete pDevice;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -157,18 +157,21 @@ bool CWII_IPC_HLE_Device_FileIO::OpenFile()
|
|||
break;
|
||||
}
|
||||
case ISFS_OPEN_WRITE:
|
||||
{
|
||||
m_pFileHandle.Open(m_Filename, "r+b");
|
||||
break;
|
||||
|
||||
}
|
||||
case ISFS_OPEN_RW:
|
||||
{
|
||||
m_pFileHandle.Open(m_Filename, "r+b");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
PanicAlertT("FileIO: Unknown open mode : 0x%02x", m_Mode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return m_pFileHandle.IsOpen();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue