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,8 +221,14 @@ void fIOthread(void * iodata)
else
{
Plugin * plug = plug_mgr->getPluginByName(plugname);
if(!plug) con.printerr("No such plugin\n");
plug->load();
if(!plug)
{
con.printerr("No such plugin\n");
}
else
{
plug->load();
}
}
}
}
@ -242,8 +248,14 @@ void fIOthread(void * iodata)
else
{
Plugin * plug = plug_mgr->getPluginByName(plugname);
if(!plug) con.printerr("No such plugin\n");
plug->reload();
if(!plug)
{
con.printerr("No such plugin\n");
}
else
{
plug->reload();
}
}
}
}
@ -263,8 +275,14 @@ void fIOthread(void * iodata)
else
{
Plugin * plug = plug_mgr->getPluginByName(plugname);
if(!plug) con.printerr("No such plugin\n");
plug->unload();
if(!plug)
{
con.printerr("No such plugin\n");
}
else
{
plug->unload();
}
}
}
}