From 35b02db39d845fb8a78920d3929d308592bbd219 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 21 Nov 2015 21:05:31 -0500 Subject: [PATCH] ISOFile: Get rid of explicit deletes --- Source/Core/DolphinWX/ISOFile.cpp | 33 ++++++++++++++----------------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/Source/Core/DolphinWX/ISOFile.cpp b/Source/Core/DolphinWX/ISOFile.cpp index 8a2edf69cf..58d7b71ad7 100644 --- a/Source/Core/DolphinWX/ISOFile.cpp +++ b/Source/Core/DolphinWX/ISOFile.cpp @@ -93,28 +93,26 @@ GameListItem::GameListItem(const std::string& _rFileName, const std::unordered_m } else { - DiscIO::IVolume* pVolume = DiscIO::CreateVolumeFromFilename(_rFileName); + std::unique_ptr volume(DiscIO::CreateVolumeFromFilename(_rFileName)); - if (pVolume != nullptr) + if (volume != nullptr) { - m_Platform = pVolume->GetVolumeType(); + m_Platform = volume->GetVolumeType(); - m_names = pVolume->GetNames(true); - m_descriptions = pVolume->GetDescriptions(); - m_company = pVolume->GetCompany(); + m_names = volume->GetNames(true); + m_descriptions = volume->GetDescriptions(); + m_company = volume->GetCompany(); - m_Country = pVolume->GetCountry(); - m_blob_type = pVolume->GetBlobType(); - m_FileSize = pVolume->GetRawSize(); - m_VolumeSize = pVolume->GetSize(); + m_Country = volume->GetCountry(); + m_blob_type = volume->GetBlobType(); + m_FileSize = volume->GetRawSize(); + m_VolumeSize = volume->GetSize(); - m_UniqueID = pVolume->GetUniqueID(); - m_disc_number = pVolume->GetDiscNumber(); - m_Revision = pVolume->GetRevision(); + m_UniqueID = volume->GetUniqueID(); + m_disc_number = volume->GetDiscNumber(); + m_Revision = volume->GetRevision(); - ReadVolumeBanner(*pVolume); - - delete pVolume; + ReadVolumeBanner(*volume); m_Valid = true; SaveToCache(); @@ -330,7 +328,7 @@ std::vector GameListItem::GetLanguages() const const std::string GameListItem::GetWiiFSPath() const { - DiscIO::IVolume *iso = DiscIO::CreateVolumeFromFilename(m_FileName); + std::unique_ptr iso(DiscIO::CreateVolumeFromFilename(m_FileName)); std::string ret; if (iso == nullptr) @@ -352,7 +350,6 @@ const std::string GameListItem::GetWiiFSPath() const else ret = path; } - delete iso; return ret; }