diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-05-06 22:05:19 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-05-06 22:05:19 +0000 |
commit | d98358886d190079bbc55b72eb67d4d217d9c687 (patch) | |
tree | 7c425c8eba7706cc00901b10a5c1f7af664d3797 /src | |
parent | 8d10212b914b555b254693c3b0666aa7079b90b2 (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')
-rw-r--r-- | src/modules/m_callerid.cpp | 12 |
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; } |