mirror of
https://github.com/Rosalie241/RMG.git
synced 2026-10-30 19:23:07 +01:00
RMG-Core: improve handling of non-existent plugin files
This commit is contained in:
1 parent
ce4321dcea
commit
147533ea45
1 file changed
+11
-2
@@ -199,8 +199,7 @@ bool apply_plugin_settings(std::string pluginSettings[4])
|
||||
{
|
||||
pluginType = (CorePluginType)(i + 1);
|
||||
settingValue = get_plugin_path(pluginType, pluginSettings[i]);
|
||||
if (settingValue.empty() ||
|
||||
!std::filesystem::is_regular_file(settingValue))
|
||||
if (settingValue.empty())
|
||||
{ // skip invalid setting value
|
||||
continue;
|
||||
}
|
||||
@@ -230,6 +229,16 @@ bool apply_plugin_settings(std::string pluginSettings[4])
|
||||
plugin->Unhook();
|
||||
}
|
||||
|
||||
// ensure library file exists
|
||||
if (!std::filesystem::is_regular_file(settingValue))
|
||||
{
|
||||
// force a re-load next time,
|
||||
// because we've unhooked
|
||||
// the existing one
|
||||
l_PluginFiles[i].clear();
|
||||
continue;
|
||||
}
|
||||
|
||||
// attempt to open the library
|
||||
handle = osal_dynlib_open(settingValue.c_str());
|
||||
if (handle == nullptr)
|
||||
|
||||
Reference in new issue
Block a user