ISOFile: Get rid of a delete call

This commit is contained in:
Lioncash 2014-11-15 13:25:21 -05:00
parent 7d8248e24f
commit 798a96bd2a
1 changed files with 17 additions and 20 deletions

View File

@ -5,6 +5,7 @@
#include <cinttypes> #include <cinttypes>
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include <memory>
#include <string> #include <string>
#include <vector> #include <vector>
#include <wx/bitmap.h> #include <wx/bitmap.h>
@ -80,11 +81,9 @@ GameListItem::GameListItem(const std::string& _rFileName)
if (pFileSystem != nullptr || m_Platform == WII_WAD) if (pFileSystem != nullptr || m_Platform == WII_WAD)
{ {
DiscIO::IBannerLoader* pBannerLoader = DiscIO::CreateBannerLoader(*pFileSystem, pVolume); std::unique_ptr<DiscIO::IBannerLoader> pBannerLoader(DiscIO::CreateBannerLoader(*pFileSystem, pVolume));
if (pBannerLoader != nullptr) if (pBannerLoader != nullptr && pBannerLoader->IsValid())
{
if (pBannerLoader->IsValid())
{ {
if (m_Platform != WII_WAD) if (m_Platform != WII_WAD)
m_banner_names = pBannerLoader->GetNames(); m_banner_names = pBannerLoader->GetNames();
@ -103,8 +102,6 @@ GameListItem::GameListItem(const std::string& _rFileName)
m_pImage[i * 3 + 2] = (pData[i] & 0x0000FF) >> 0; m_pImage[i * 3 + 2] = (pData[i] & 0x0000FF) >> 0;
} }
} }
delete pBannerLoader;
}
delete pFileSystem; delete pFileSystem;
} }