Fix crash when using load, unload and reload commands.

develop
Petr Mrázek 2011-11-07 10:55:18 +01:00
parent 2c27119d85
commit 7e475970fb
1 changed files with 24 additions and 6 deletions

@ -221,11 +221,17 @@ void fIOthread(void * iodata)
else
{
Plugin * plug = plug_mgr->getPluginByName(plugname);
if(!plug) con.printerr("No such plugin\n");
if(!plug)
{
con.printerr("No such plugin\n");
}
else
{
plug->load();
}
}
}
}
else if( first == "reload" )
{
if(parts.size())
@ -242,11 +248,17 @@ void fIOthread(void * iodata)
else
{
Plugin * plug = plug_mgr->getPluginByName(plugname);
if(!plug) con.printerr("No such plugin\n");
if(!plug)
{
con.printerr("No such plugin\n");
}
else
{
plug->reload();
}
}
}
}
else if( first == "unload" )
{
if(parts.size())
@ -263,11 +275,17 @@ void fIOthread(void * iodata)
else
{
Plugin * plug = plug_mgr->getPluginByName(plugname);
if(!plug) con.printerr("No such plugin\n");
if(!plug)
{
con.printerr("No such plugin\n");
}
else
{
plug->unload();
}
}
}
}
else if(first == "ls" || first == "dir")
{
if(parts.size())