summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/command_parse.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index e4c987c19..3373f714f 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -593,7 +593,13 @@ const char* CommandParser::LoadCommand(const char* name)
void CommandParser::SetupCommandTable(User* user)
{
- RFCCommands.clear();
+ for (SharedObjectList::iterator command = RFCCommands.begin(); command != RFCCommands.end(); command++)
+ {
+ Command *cmdptr = cmdlist.find(command->first)->second;
+ cmdlist.erase(cmdlist.find(command->first));
+ RFCCommands.erase(command);
+ delete cmdptr;
+ }
if (!user)
{