mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Fix a possible crash on close due to INANDContentLoader objects getting deleted twice
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4463 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -83,11 +83,11 @@ CWII_IPC_HLE_Device_es::CWII_IPC_HLE_Device_es(u32 _DeviceID, const std::string&
|
|||||||
|
|
||||||
// scan for the title ids listed in TMDs within /title/
|
// scan for the title ids listed in TMDs within /title/
|
||||||
m_TitleIDs.clear();
|
m_TitleIDs.clear();
|
||||||
m_TitleIDs.push_back(0x0000000100000002ULL);
|
m_TitleIDs.push_back(0x0000000100000002ULL);
|
||||||
// m_TitleIDs.push_back(0x0001000248414741ULL);
|
//m_TitleIDs.push_back(0x0001000248414741ULL);
|
||||||
// m_TitleIDs.push_back(0x0001000248414341ULL);
|
//m_TitleIDs.push_back(0x0001000248414341ULL);
|
||||||
// m_TitleIDs.push_back(0x0001000248414241ULL);
|
//m_TitleIDs.push_back(0x0001000248414241ULL);
|
||||||
// m_TitleIDs.push_back(0x0001000248414141ULL);
|
//m_TitleIDs.push_back(0x0001000248414141ULL);
|
||||||
|
|
||||||
//FindValidTitleIDs();
|
//FindValidTitleIDs();
|
||||||
|
|
||||||
@ -97,13 +97,7 @@ CWII_IPC_HLE_Device_es::CWII_IPC_HLE_Device_es(u32 _DeviceID, const std::string&
|
|||||||
|
|
||||||
CWII_IPC_HLE_Device_es::~CWII_IPC_HLE_Device_es()
|
CWII_IPC_HLE_Device_es::~CWII_IPC_HLE_Device_es()
|
||||||
{
|
{
|
||||||
CTitleToContentMap::const_iterator itr = m_NANDContent.begin();
|
// Leave deletion of the INANDContentLoader objects to CNANDContentManager, don't do it here!
|
||||||
while(itr != m_NANDContent.end())
|
|
||||||
{
|
|
||||||
if (itr->second)
|
|
||||||
delete itr->second;
|
|
||||||
itr++;
|
|
||||||
}
|
|
||||||
m_NANDContent.clear();
|
m_NANDContent.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ bool CWII_IPC_HLE_Device_fs::IOCtlV(u32 _CommandAddress)
|
|||||||
Extensions.push_back("*.*");
|
Extensions.push_back("*.*");
|
||||||
|
|
||||||
CFileSearch FileSearch(Extensions, Directories);
|
CFileSearch FileSearch(Extensions, Directories);
|
||||||
|
|
||||||
u64 overAllSize = 0;
|
u64 overAllSize = 0;
|
||||||
for (size_t i=0; i<FileSearch.GetFileNames().size(); i++)
|
for (size_t i=0; i<FileSearch.GetFileNames().size(); i++)
|
||||||
{
|
{
|
||||||
@ -220,7 +220,7 @@ bool CWII_IPC_HLE_Device_fs::IOCtlV(u32 _CommandAddress)
|
|||||||
// PanicAlert("IOCTL_GETUSAGE - unk dir %s", Filename.c_str());
|
// PanicAlert("IOCTL_GETUSAGE - unk dir %s", Filename.c_str());
|
||||||
WARN_LOG(WII_IPC_FILEIO, " error: not executed on a valid directoy: %s", Filename.c_str());
|
WARN_LOG(WII_IPC_FILEIO, " error: not executed on a valid directoy: %s", Filename.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
Memory::Write_U32(fsBlock, CommandBuffer.PayloadBuffer[0].m_Address);
|
Memory::Write_U32(fsBlock, CommandBuffer.PayloadBuffer[0].m_Address);
|
||||||
Memory::Write_U32(iNodes, CommandBuffer.PayloadBuffer[1].m_Address);
|
Memory::Write_U32(iNodes, CommandBuffer.PayloadBuffer[1].m_Address);
|
||||||
}
|
}
|
||||||
@ -233,7 +233,7 @@ bool CWII_IPC_HLE_Device_fs::IOCtlV(u32 _CommandAddress)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Memory::Write_U32(ReturnValue, _CommandAddress+4);
|
Memory::Write_U32(ReturnValue, _CommandAddress+4);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ CNANDContentLoader::CNANDContentLoader(const std::string& _rName)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// _dbg_assert_msg_(BOOT, 0, "CNANDContentLoader loads neither folder nor file");
|
_dbg_assert_msg_(BOOT, 0, "CNANDContentLoader loads neither folder nor file");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,14 +362,12 @@ CNANDContentManager::~CNANDContentManager()
|
|||||||
|
|
||||||
const INANDContentLoader& CNANDContentManager::GetNANDLoader(const std::string& _rName)
|
const INANDContentLoader& CNANDContentManager::GetNANDLoader(const std::string& _rName)
|
||||||
{
|
{
|
||||||
std::string KeyString(_rName);
|
CNANDContentMap::iterator lb = m_Map.lower_bound(_rName);
|
||||||
|
|
||||||
CNANDContentMap::iterator itr = m_Map.find(KeyString);
|
if(lb == m_Map.end() || (m_Map.key_comp()(_rName, lb->first)))
|
||||||
if (itr != m_Map.end())
|
m_Map.insert(lb, CNANDContentMap::value_type(_rName, new CNANDContentLoader(_rName)));
|
||||||
return *itr->second;
|
|
||||||
|
|
||||||
m_Map[KeyString] = new CNANDContentLoader(KeyString);
|
return *m_Map[_rName];
|
||||||
return *m_Map[KeyString];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace end
|
} // namespace end
|
||||||
|
Reference in New Issue
Block a user