diff options
Diffstat (limited to 'src/modules/m_hidechans.cpp')
-rw-r--r-- | src/modules/m_hidechans.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/modules/m_hidechans.cpp b/src/modules/m_hidechans.cpp index 8ca14f1a4..96f5ef560 100644 --- a/src/modules/m_hidechans.cpp +++ b/src/modules/m_hidechans.cpp @@ -48,13 +48,11 @@ class HideChans : public ModeHandler class ModuleHideChans : public Module { bool AffectsOpers; - HideChans* hm; + HideChans hm; public: - ModuleHideChans(InspIRCd* Me) : Module(Me) + ModuleHideChans(InspIRCd* Me) : Module(Me), hm(Me) { - - hm = new HideChans(ServerInstance); - if (!ServerInstance->Modes->AddMode(hm)) + if (!ServerInstance->Modes->AddMode(&hm)) throw ModuleException("Could not add new modes!"); Implementation eventlist[] = { I_OnWhoisLine, I_OnRehash }; ServerInstance->Modules->Attach(eventlist, this, 2); @@ -63,8 +61,7 @@ class ModuleHideChans : public Module virtual ~ModuleHideChans() { - ServerInstance->Modes->DelMode(hm); - delete hm; + ServerInstance->Modes->DelMode(&hm); } virtual Version GetVersion() |