summaryrefslogtreecommitdiff
path: root/src/modules/m_knock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_knock.cpp')
-rw-r--r--src/modules/m_knock.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp
index 5e6501699..45b213b40 100644
--- a/src/modules/m_knock.cpp
+++ b/src/modules/m_knock.cpp
@@ -78,26 +78,21 @@ class Knock : public SimpleChannelModeHandler
class ModuleKnock : public Module
{
- CommandKnock* mycommand;
- Knock* kn;
+ CommandKnock cmd;
+ Knock kn;
public:
- ModuleKnock(InspIRCd* Me) : Module(Me)
+ ModuleKnock(InspIRCd* Me) : Module(Me), cmd(Me), kn(Me)
{
- kn = new Knock(ServerInstance);
-
- if (!ServerInstance->Modes->AddMode(kn))
+ if (!ServerInstance->Modes->AddMode(&kn))
throw ModuleException("Could not add new modes!");
-
- mycommand = new CommandKnock(ServerInstance);
- ServerInstance->AddCommand(mycommand);
+ ServerInstance->AddCommand(&cmd);
}
virtual ~ModuleKnock()
{
- ServerInstance->Modes->DelMode(kn);
- delete kn;
+ ServerInstance->Modes->DelMode(&kn);
}
virtual Version GetVersion()