Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SofaKernel] FIX PluginManager::pluginIsLoaded #1615

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -374,14 +374,28 @@ bool PluginManager::pluginIsLoaded(const std::string& plugin)
{
std::string pluginPath = plugin;

if (!FileSystem::isFile(plugin)) {
/// If we are not providing a filename then we have either to iterate in the plugin
/// map to check no plugin has the same name or check in there is no accessible path
/// in the plugin repository matching the pluginName
if (!FileSystem::isFile(plugin))
{
/// Here is the iteration in the loaded plugin map
for(auto k : m_pluginMap)
{
if(plugin == k.second.getModuleName())
return true;
}

/// At this point we have not found a loaded plugin, we try to
/// explore if the filesystem can help.
pluginPath = findPlugin(plugin);
}

/// Check that the path (either provided by user or through the call to findPlugin()
/// leads to a loaded plugin.
return m_pluginMap.find(pluginPath) != m_pluginMap.end();
}


bool PluginManager::checkDuplicatedPlugin(const Plugin& plugin, const std::string& pluginPath)
{
for (auto itP : m_pluginMap)
Expand Down