added destructor

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2460 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
fires.gc 2009-02-28 01:48:37 +00:00
parent 4bdb4aa0d1
commit 0e9a49af7f
2 changed files with 14 additions and 4 deletions

View File

@ -62,7 +62,15 @@ CNANDContentLoader::CNANDContentLoader(const std::string& _rName)
{
// _dbg_assert_msg_(BOOT, 0, "CNANDContentLoader loads neither folder nor file");
}
}
CNANDContentLoader::~CNANDContentLoader()
{
for (size_t i=0; i<m_TileMetaContent.size(); i++)
{
delete [] m_TileMetaContent[i].m_pData;
}
m_TileMetaContent.clear();
}
SNANDContent* CNANDContentLoader::GetContentByIndex(int _Index)
@ -125,7 +133,7 @@ bool CNANDContentLoader::CreateFromDirectory(const std::string& _rPath)
sprintf(szFilename, "%s\\%08x.app", _rPath.c_str(), rContent.m_ContentID);
FILE* pFile = fopen(szFilename, "rb");
// i have seen TMD which index to app which doesn't exist...
// i have seen TMDs which index to app which doesn't exist...
if (pFile != NULL)
{
u64 Size = File::GetSize(szFilename);

View File

@ -41,10 +41,12 @@ public:
CNANDContentLoader(const std::string& _rName);
virtual ~CNANDContentLoader();
bool IsValid() const { return m_Valid; }
u64 GetTitleID() const { return m_TitleID; }
u32 GetBootIndex() const { return m_BootIndex; }
size_t GetContentSize() const { return m_TitleMetaContent.size(); }
size_t GetContentSize() const { return m_Content.size(); }
SNANDContent* GetContentByIndex(int _Index);
static bool IsWiiWAD(const std::string& _rName);
@ -55,7 +57,7 @@ private:
u64 m_TitleID;
u32 m_BootIndex;
std::vector<SNANDContent> m_TitleMetaContent;
std::vector<SNANDContent> m_Content;
bool CreateFromDirectory(const std::string& _rPath);
bool CreateFromWAD(const std::string& _rName);