]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_kick.cpp
Fix MySQL crash on module unload with empty query queue
[user/henk/code/inspircd.git] / src / commands / cmd_kick.cpp
index 54a5bd88834c9f604a53f0e4d6a47863d2135bf9..39e2c4433f1a4ef6a3313e5bddf9b94d3f43beda 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
 
 #include "inspircd.h"
 
-#ifndef __CMD_KICK_H__
-#define __CMD_KICK_H__
-
-// include the common header files
-
-#include "users.h"
-#include "channels.h"
-
 /** Handle /KICK. These command handlers can be reloaded by the core,
  * and handle basic RFC1459 commands. Commands within modules work
  * the same way, however, they can be fully unloaded, where these
@@ -31,7 +23,7 @@ class CommandKick : public Command
  public:
        /** Constructor for kick.
         */
-       CommandKick (InspIRCd* Instance, Module* parent) : Command(Instance,parent,"KICK",0,2) { syntax = "<channel> <nick>{,<nick>} [<reason>]"; }
+       CommandKick ( Module* parent) : Command(parent,"KICK",2,3) { syntax = "<channel> <nick>{,<nick>} [<reason>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
@@ -41,8 +33,6 @@ class CommandKick : public Command
        CmdResult Handle(const std::vector<std::string>& parameters, User *user);
 };
 
-#endif
-
 
 /** Handle /KICK
  */
@@ -76,9 +66,7 @@ CmdResult CommandKick::Handle (const std::vector<std::string>& parameters, User
                reason.assign(user->nick, 0, ServerInstance->Config->Limits.MaxKick);
        }
 
-       if (!c->KickUser(user, u, reason.c_str()))
-               /* Nobody left here, delete the Channel */
-               delete c;
+       c->KickUser(user, u, reason.c_str());
 
        return CMD_SUCCESS;
 }