Minor cleanup. Fix file handle leak when opening zip files from the main screen.

This commit is contained in:
Henrik Rydgård committed 2025-04-07 15:42:51 +02:00
1 parent 0dec3526a5
commit 605daf879b
5 files changed
+25 -8

No files matched your search

+2 -3
View File
@@ -77,14 +77,13 @@ bool MainScreen::showHomebrewTab = false;
bool LaunchFile(ScreenManager *screenManager, const Path &path) {
// Depending on the file type, we don't want to launch EmuScreen at all.
auto loader = ConstructFileLoader(path);
std::unique_ptr<FileLoader> loader(ConstructFileLoader(path));
if (!loader) {
return false;
}
std::string errorString;
IdentifiedFileType type = Identify_File(loader, &errorString);
delete loader;
IdentifiedFileType type = Identify_File(loader.get(), &errorString);
switch (type) {
case IdentifiedFileType::ARCHIVE_ZIP: