[App] Remove possible leftover temporary files.

This commit is contained in:
2025-07-29 21:38:57 +01:00
parent cb4511c09d
commit b68f6f792f
2 changed files with 12 additions and 4 deletions

View File

@@ -334,11 +334,15 @@ public partial class ImportRoms : ComponentBase
KnownOnlyChecked,
RemoveFilesChecked);
string tmpFile = Path.Combine(Settings.Settings.Current.RepositoryPath,
Path.GetRandomFileName());
worker.ImportAndHashRom(reader.OpenEntryStream(),
reader.Entry.Key,
Path.Combine(Settings.Settings.Current.RepositoryPath,
Path.GetFileName(Path.GetTempFileName())),
tmpFile,
reader.Entry.Size);
if(File.Exists(tmpFile)) File.Delete(tmpFile);
}
}
catch(InvalidOperationException) {}