From d98358886d190079bbc55b72eb67d4d217d9c687 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 6 May 2008 22:05:19 +0000 Subject: 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 --- src/modules/m_callerid.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/modules') 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; } -- cgit v1.2.3