Added error handling to load <plugin> command
This commit is contained in:
parent
8fbd65e775
commit
1a46feda43
@ -1525,6 +1525,15 @@ bool cPluginManager::DisablePlugin(const AString & a_PluginName)
|
||||
|
||||
bool cPluginManager::LoadPlugin(const AString & a_PluginName)
|
||||
{
|
||||
PluginMap map = GetAllPlugins();
|
||||
|
||||
for(auto plugin_entry : map)
|
||||
{
|
||||
if(plugin_entry.first == a_PluginName)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return AddPlugin(new cPluginLua(a_PluginName.c_str()));
|
||||
}
|
||||
|
||||
@ -1828,6 +1837,7 @@ bool cPluginManager::DoWithPlugin(const AString & a_PluginName, cPluginCallback
|
||||
bool cPluginManager::AddPlugin(cPlugin * a_Plugin)
|
||||
{
|
||||
m_Plugins[a_Plugin->GetDirectory()] = a_Plugin;
|
||||
|
||||
if (a_Plugin->Initialize())
|
||||
{
|
||||
// Initialization OK
|
||||
|
Loading…
Reference in New Issue
Block a user