mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2026-01-11 08:39:12 +01:00
Added check for dp not being NULL for every closedir command to avoid crashes under MacOS.
This commit is contained in:
parent
dfcf267eba
commit
3d69bd65a7
@ -477,7 +477,7 @@ void CollectionInfoBuilder::addPlaylists(CollectionInfo *info)
|
||||
}
|
||||
}
|
||||
|
||||
closedir(dp);
|
||||
if (dp) closedir(dp);
|
||||
|
||||
if(info->playlists["favorites"] == NULL)
|
||||
{
|
||||
@ -688,7 +688,7 @@ void CollectionInfoBuilder::ImportRomDirectory(std::string path, CollectionInfo
|
||||
}
|
||||
}
|
||||
|
||||
closedir(dp);
|
||||
if (dp) closedir(dp);
|
||||
|
||||
return;
|
||||
|
||||
|
||||
@ -96,7 +96,7 @@ bool MenuParser::buildTextMenu(CollectionInfo *collection, bool sort)
|
||||
}
|
||||
}
|
||||
|
||||
closedir(dp);
|
||||
if (dp) closedir(dp);
|
||||
std::sort(menuItems.begin(), menuItems.end(), [](Item *a, Item *b) {return Utils::toLower(a->fullTitle) <= Utils::toLower(b->fullTitle);});
|
||||
|
||||
}
|
||||
|
||||
@ -152,7 +152,7 @@ bool MetadataDatabase::importDirectory()
|
||||
}
|
||||
}
|
||||
|
||||
closedir(dp);
|
||||
if (dp) closedir(dp);
|
||||
}
|
||||
|
||||
dp = opendir(mameListPath.c_str());
|
||||
@ -185,7 +185,7 @@ bool MetadataDatabase::importDirectory()
|
||||
}
|
||||
}
|
||||
|
||||
closedir(dp);
|
||||
if (dp) closedir(dp);
|
||||
}
|
||||
|
||||
dp = opendir(emuarcListPath.c_str());
|
||||
@ -216,7 +216,7 @@ bool MetadataDatabase::importDirectory()
|
||||
}
|
||||
}
|
||||
|
||||
closedir(dp);
|
||||
if (dp) closedir(dp);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -716,10 +716,7 @@ time_t MetadataDatabase::timeDir( std::string path )
|
||||
}
|
||||
}
|
||||
|
||||
if (dp != NULL)
|
||||
{
|
||||
closedir( dp );
|
||||
}
|
||||
if (dp) closedir( dp );
|
||||
|
||||
return lastTime;
|
||||
}
|
||||
|
||||
@ -174,14 +174,14 @@ bool ImportConfiguration(Configuration *c)
|
||||
if(!c->import(prefix, importFile))
|
||||
{
|
||||
Logger::write(Logger::ZONE_ERROR, "RetroFE", "Could not import \"" + importFile + "\"");
|
||||
closedir(dp);
|
||||
if (dp) closedir(dp);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
closedir(dp);
|
||||
if (dp) closedir(dp);
|
||||
|
||||
dp = opendir(collectionsPath.c_str());
|
||||
|
||||
@ -212,7 +212,7 @@ bool ImportConfiguration(Configuration *c)
|
||||
}
|
||||
}
|
||||
|
||||
closedir(dp);
|
||||
if (dp) closedir(dp);
|
||||
|
||||
Logger::write(Logger::ZONE_INFO, "RetroFE", "Imported configuration");
|
||||
|
||||
|
||||
@ -1715,7 +1715,7 @@ CollectionInfo *RetroFE::getCollection(std::string collectionName)
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir( dp );
|
||||
if (dp) closedir( dp );
|
||||
|
||||
bool menuSort = true;
|
||||
config_.getProperty( "collections." + collectionName + ".list.menuSort", menuSort );
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
std::string retrofe_version_major = "0";
|
||||
std::string retrofe_version_minor = "9";
|
||||
std::string retrofe_version_build = "39";
|
||||
std::string retrofe_version_build = "40";
|
||||
|
||||
|
||||
std::string Version::getString( )
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user