1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 03:46:36 +02:00

addModule + delModule compressed into constructor/destructor.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1615 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
Robin Burchell w00t@inspircd.org
2008-11-09 19:03:56 +00:00
parent 65fd49d362
commit 649a12c07f
5 changed files with 53 additions and 78 deletions
+6 -4
View File
@@ -221,13 +221,15 @@ int ModuleManager::LoadModule(const std::string &modname, User * u)
if (m->type == PROTOCOL && protocolModuleLoaded())
{
delete m;
alog("You cannot load two protocol modules");
ret = MOD_STOP;
return MOD_STOP;
}
else if (m->type == ENCRYPTION && encryptionModuleLoaded())
{
delete m;
alog("You cannot load two encryption modules");
ret = MOD_STOP;
return MOD_STOP;
}
mod_current_module_name = NULL;
@@ -237,7 +239,7 @@ int ModuleManager::LoadModule(const std::string &modname, User * u)
ircdproto->SendGlobops(s_OperServ, "%s loaded module %s", u->nick, modname.c_str());
notice_lang(s_OperServ, u, OPER_MODULE_LOADED, modname.c_str());
}
addModule(m);
return MOD_ERR_OK;
}
@@ -263,7 +265,7 @@ int ModuleManager::UnloadModule(Module * m, User * u)
notice_lang(s_OperServ, u, OPER_MODULE_UNLOADED, m->name.c_str());
}
delModule(m);
delete m;
return MOD_ERR_OK;
}