diff --git a/common/include/Utilities/Dependencies.h b/common/include/Utilities/Dependencies.h index f0c70cad19..1ad38db121 100644 --- a/common/include/Utilities/Dependencies.h +++ b/common/include/Utilities/Dependencies.h @@ -199,6 +199,7 @@ public: #include #include #include +#include #include "Pcsx2Defs.h" diff --git a/pcsx2/CDVD/CDVD.cpp b/pcsx2/CDVD/CDVD.cpp index 3daa786f01..13d6089e3d 100644 --- a/pcsx2/CDVD/CDVD.cpp +++ b/pcsx2/CDVD/CDVD.cpp @@ -17,6 +17,7 @@ #include "IopCommon.h" #include "AppConfig.h" +#include #include #include @@ -341,8 +342,6 @@ static __fi ElfObject* loadElf( const wxString filename ) static __fi void _reloadElfInfo(wxString elfpath) { - ScopedPtr elfptr; - // Now's a good time to reload the ELF info... ScopedLock locker( Mutex_NewDiskCB ); @@ -357,7 +356,7 @@ static __fi void _reloadElfInfo(wxString elfpath) if (fname.Matches(L"????_???.??*")) DiscSerial = fname(0,4) + L"-" + fname(5,3) + fname(9,2); - elfptr = loadElf(elfpath); + std::unique_ptr elfptr(loadElf(elfpath)); elfptr->loadHeaders(); ElfCRC = elfptr->getCRC(); diff --git a/pcsx2/CDVD/IsoFS/IsoFS.cpp b/pcsx2/CDVD/IsoFS/IsoFS.cpp index 80a215ccd4..2925edec3a 100644 --- a/pcsx2/CDVD/IsoFS/IsoFS.cpp +++ b/pcsx2/CDVD/IsoFS/IsoFS.cpp @@ -18,6 +18,7 @@ #include "IsoFS.h" #include "IsoFile.h" +#include ////////////////////////////////////////////////////////////////////////// // IsoDirectory @@ -172,7 +173,7 @@ IsoFileDescriptor IsoDirectory::FindFile(const wxString& filePath) const wxFileName parts( filePath, wxPATH_DOS ); IsoFileDescriptor info; const IsoDirectory* dir = this; - ScopedPtr deleteme; + std::unique_ptr deleteme; // walk through path ("." and ".." entries are in the directories themselves, so even if the // path included . and/or .., it still works) @@ -182,7 +183,8 @@ IsoFileDescriptor IsoDirectory::FindFile(const wxString& filePath) const info = dir->GetEntry(parts.GetDirs()[i]); if(info.IsFile()) throw Exception::FileNotFound( filePath ); - dir = deleteme = new IsoDirectory(internalReader, info); + deleteme.reset(new IsoDirectory(internalReader, info)); + dir = deleteme.get(); } if( !parts.GetFullName().IsEmpty() ) diff --git a/pcsx2/CDVD/IsoFileFormats.h b/pcsx2/CDVD/IsoFileFormats.h index 4229a5e6cb..2100ef168e 100644 --- a/pcsx2/CDVD/IsoFileFormats.h +++ b/pcsx2/CDVD/IsoFileFormats.h @@ -117,7 +117,7 @@ protected: std::unique_ptr m_dtable; int m_dtablesize; - ScopedPtr m_outstream; + std::unique_ptr m_outstream; public: OutputIsoFile(); diff --git a/pcsx2/CDVD/OutputIsoFile.cpp b/pcsx2/CDVD/OutputIsoFile.cpp index ec9c2eef4d..dab16be95c 100644 --- a/pcsx2/CDVD/OutputIsoFile.cpp +++ b/pcsx2/CDVD/OutputIsoFile.cpp @@ -62,7 +62,7 @@ void OutputIsoFile::Create(const wxString& filename, int version) m_blockofs = 24; m_blocksize = 2048; - m_outstream = new wxFileOutputStream( m_filename ); + m_outstream = std::unique_ptr(new wxFileOutputStream(m_filename)); pxStream_OpenCheck( *m_outstream, m_filename, L"writing" ); Console.WriteLn("isoFile create ok: %s ", WX_STR(m_filename));