Skip to content

Commit

Permalink
HandleMultipleEntryRar memory leak fix with auto-destructor (#2698)
Browse files Browse the repository at this point in the history
  • Loading branch information
adipose committed Apr 1, 2024
1 parent 2aca354 commit 1972f8d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/mpc-hc/MainFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12850,7 +12850,7 @@ HRESULT CMainFrame::PreviewWindowShow(REFERENCE_TIME rtCur2) {
}

HRESULT CMainFrame::HandleMultipleEntryRar(CStringW fn) {
CRFSList <CRFSFile> file_list;
CRFSList <CRFSFile> file_list(true); //true = clears itself on destruction
int num_files, num_ok_files;

CRARFileSource::ScanArchive(fn.GetBuffer(), &file_list, &num_files, &num_ok_files);
Expand All @@ -12859,12 +12859,10 @@ HRESULT CMainFrame::HandleMultipleEntryRar(CStringW fn) {
if (IDOK == entrySelector.DoModal()) {
CStringW entryName = entrySelector.GetCurrentEntry();
if (entryName.GetLength() > 0) {
file_list.Clear();
CComPtr<CFGManager> fgm = static_cast<CFGManager*>(m_pGB.p);
return fgm->RenderRFSFileEntry(fn, nullptr, entryName);
}
}
file_list.Clear();
return RFS_E_ABORT; //we found multiple entries but no entry selected.
}
return E_NOTIMPL; //not a multi-entry rar
Expand Down

0 comments on commit 1972f8d

Please sign in to comment.