]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_part.cpp
Fix MySQL crash on module unload with empty query queue
[user/henk/code/inspircd.git] / src / commands / cmd_part.cpp
index e2e4e59a02960542f0f444d914e9a3aab4c195bb..ba8420cd69b063f40edd5f5e9493fadcb6924abd 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
@@ -39,12 +39,12 @@ CmdResult CommandPart::Handle (const std::vector<std::string>& parameters, User
 
        if (IS_LOCAL(user))
        {
-               if (*ServerInstance->Config->FixedPart)
+               if (!ServerInstance->Config->FixedPart.empty())
                        reason = ServerInstance->Config->FixedPart;
                else
                {
                        if (parameters.size() > 1)
-                               reason = ServerInstance->Config->PrefixPart + std::string(parameters[1]) + ServerInstance->Config->SuffixPart;
+                               reason = ServerInstance->Config->PrefixPart + parameters[1] + ServerInstance->Config->SuffixPart;
                        else
                                reason = "";
                }
@@ -61,9 +61,7 @@ CmdResult CommandPart::Handle (const std::vector<std::string>& parameters, User
 
        if (c)
        {
-               if (!c->PartUser(user, reason))
-                       /* Arse, who stole our channel! :/ */
-                       delete c;
+               c->PartUser(user, reason);
        }
        else
        {