1
0
mirror of synced 2025-02-17 18:59:21 +01:00

fix: Potential crash on Linux when loading external libraries

This commit is contained in:
WerWolv 2024-03-15 17:54:09 +01:00
parent a1437658af
commit 373db3de95
2 changed files with 3 additions and 3 deletions

View File

@ -108,7 +108,7 @@ namespace hex {
static bool load(const std::fs::path &pluginFolder);
static bool loadLibraries();
static bool loadLibraries(const std::fs::path &pluginFolder);
static bool loadLibraries(const std::fs::path &libraryFolder);
static void unload();
static void reload();

View File

@ -312,9 +312,9 @@ namespace hex {
return success;
}
bool PluginManager::loadLibraries(const std::fs::path& pluginFolder) {
bool PluginManager::loadLibraries(const std::fs::path& libraryFolder) {
bool success = true;
for (const auto &entry : std::fs::recursive_directory_iterator(pluginFolder)) {
for (const auto &entry : std::fs::directory_iterator(libraryFolder)) {
if (!(entry.path().extension() == ".dll" || entry.path().extension() == ".so" || entry.path().extension() == ".dylib"))
continue;