diff options
author | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-09 19:03:56 +0000 |
---|---|---|
committer | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-09 19:03:56 +0000 |
commit | 649a12c07ffd4340594486d31fa703fb78103222 (patch) | |
tree | 66b354a55523a12b8ad9c732f78c4df30fc0a8cd /src/modulemanager.cpp | |
parent | 65fd49d3628dd8d3bde8f70b58ac458785a261d7 (diff) |
addModule + delModule compressed into constructor/destructor.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1615 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/modulemanager.cpp')
-rw-r--r-- | src/modulemanager.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/modulemanager.cpp b/src/modulemanager.cpp index 3d22fb50a..3ff8835f6 100644 --- a/src/modulemanager.cpp +++ b/src/modulemanager.cpp @@ -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; } |