summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-06 22:05:19 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-06 22:05:19 +0000
commitd98358886d190079bbc55b72eb67d4d217d9c687 (patch)
tree7c425c8eba7706cc00901b10a5c1f7af664d3797 /src/modules
parent8d10212b914b555b254693c3b0666aa7079b90b2 (diff)
Fix bad throws and some other stuff in this module
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9657 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_callerid.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp
index 2a349fdb0..43d546f92 100644
--- a/src/modules/m_callerid.cpp
+++ b/src/modules/m_callerid.cpp
@@ -201,17 +201,20 @@ public:
OnRehash(NULL, "");
mycommand = new CommandAccept(ServerInstance, maxaccepts);
myumode = new User_g(ServerInstance);
- try {
+ try
+ {
ServerInstance->AddCommand(mycommand);
- } catch (const ModuleException& e) {
+ }
+ catch (const ModuleException& e)
+ {
delete mycommand;
- throw;
+ throw ModuleException("Could not add command!");
}
if (!ServerInstance->Modes->AddMode(myumode))
{
delete mycommand;
delete myumode;
- throw new ModuleException("Could not add usermode and command!");
+ throw ModuleException("Could not add usermode +g");
}
Implementation eventlist[] = { I_OnRehash, I_OnUserPreNick, I_OnUserQuit, I_On005Numeric, I_OnUserPreNotice, I_OnUserPreMessage, I_OnCleanup };
ServerInstance->Modules->Attach(eventlist, this, 7);
@@ -219,6 +222,7 @@ public:
~ModuleCallerID()
{
+ ServerInstance->Modes->DelMode(myumode);
delete myumode;
}