Merge remote-tracking branch 'origin/topic/awelzel/duplicate-plugin-no-debug'

* origin/topic/awelzel/duplicate-plugin-no-debug:
  plugin/Manager: Warn when plugin with the same name is found
This commit is contained in:
Arne Welzel 2023-06-15 18:36:25 +02:00
commit 5a9c6d4633
5 changed files with 49 additions and 4 deletions

View file

@ -112,10 +112,10 @@ void Manager::SearchDynamicPlugins(const std::string& dir)
if ( name.empty() )
reporter->FatalError("empty plugin magic file %s", magic.c_str());
if ( dynamic_plugins.find(lower_name) != dynamic_plugins.end() )
if ( const auto& other = dynamic_plugins.find(lower_name); other != dynamic_plugins.end() )
{
DBG_LOG(DBG_PLUGINS, "Found already known plugin %s in %s, ignoring", name.c_str(),
dir.c_str());
reporter->Warning("ignoring dynamic plugin %s from %s, already found in %s",
name.c_str(), dir.c_str(), other->second.c_str());
return;
}