]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_botmode.cpp
Remove useless vector copy
[user/henk/code/inspircd.git] / src / modules / m_botmode.cpp
index 025e9cf3b741b909343e0d394360d9607340fa5a..01bc4635798e7091340ad8f3b1ca58c9f473b336 100644 (file)
@@ -2,8 +2,8 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
@@ -25,15 +25,12 @@ class BotMode : public SimpleUserModeHandler
 
 class ModuleBotMode : public Module
 {
-
-       BotMode* bm;
+       BotMode bm;
  public:
        ModuleBotMode(InspIRCd* Me)
-               : Module(Me)
+               : Module(Me), bm(Me)
        {
-
-               bm = new BotMode(ServerInstance);
-               if (!ServerInstance->Modes->AddMode(bm))
+               if (!ServerInstance->Modes->AddMode(&bm))
                        throw ModuleException("Could not add new modes!");
                Implementation eventlist[] = { I_OnWhois };
                ServerInstance->Modules->Attach(eventlist, this, 1);
@@ -42,8 +39,7 @@ class ModuleBotMode : public Module
 
        virtual ~ModuleBotMode()
        {
-               ServerInstance->Modes->DelMode(bm);
-               delete bm;
+               ServerInstance->Modes->DelMode(&bm);
        }
 
        virtual Version GetVersion()