1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-19 04:53:12 +01:00

Fix #13445: Make FileScanner::ScanDirectory return a unique_ptr

Also fixes a resource leak in TitleSequence::GetSaves.
This commit is contained in:
Silent
2021-05-20 17:06:53 +02:00
parent efd5d7dfe7
commit 94da3cf422
13 changed files with 17 additions and 19 deletions

View File

@@ -274,7 +274,7 @@ std::string ImageTable::FindLegacyObject(const std::string& name)
{
// Search recursively for any file with the target name (case insensitive)
auto filter = Path::Combine(objectsPath, "*.dat");
auto scanner = std::unique_ptr<IFileScanner>(Path::ScanDirectory(filter, true));
auto scanner = Path::ScanDirectory(filter, true);
while (scanner->Next())
{
auto currentName = Path::GetFileName(scanner->GetPathRelative());