From 1d5b250b58687f400af62a95609fbaa854b4f655 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sun, 20 Jul 2014 22:54:58 +0200 Subject: [PATCH] pcsx2/cdvd: kill a small memory leak --- pcsx2/CDVD/InputIsoFile.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pcsx2/CDVD/InputIsoFile.cpp b/pcsx2/CDVD/InputIsoFile.cpp index 31cfee40d9..ceb3451c7f 100644 --- a/pcsx2/CDVD/InputIsoFile.cpp +++ b/pcsx2/CDVD/InputIsoFile.cpp @@ -241,9 +241,12 @@ bool InputIsoFile::Open( const wxString& srcfile, bool testOnly ) m_reader->SetDataOffset(m_offset); m_reader->SetBlockSize(m_blocksize); - + // Returns the original reader if single-part or a Multipart reader otherwise + AsyncFileReader* m_reader_old = m_reader; m_reader = MultipartFileReader::DetectMultipart(m_reader); + if (m_reader != m_reader_old) // Not the same object the old one need to be deleted + delete m_reader_old; } m_blocks = m_reader->GetBlockCount();