diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:46:29 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:46:29 +0000 |
commit | 1ea2fca7678ca3fe585c5812f9f62799e4a46ec5 (patch) | |
tree | ca6d3be2f58975c4f6c86c75c95a9d74bb05d81a /src/command_parse.cpp | |
parent | e581679d1fe4af527fd9e456569266271144b4ce (diff) |
Valgrind cleanup: Add RemoveRFCCommands() to dlclose() and delete the core commands
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11613 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/command_parse.cpp')
-rw-r--r-- | src/command_parse.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp index b063e392c..3f8f63c48 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -425,6 +425,19 @@ void CommandParser::RemoveCommands(const char* source) } } +void CommandParser::RemoveRFCCommands() +{ + for(SharedObjectList::iterator c = RFCCommands.begin(); c != RFCCommands.end(); c++) + { + std::string cmd = c->first; + Command* cmdptr = cmdlist.find(cmd)->second; + cmdlist.erase(cmdlist.find(cmd)); + delete cmdptr; + dlclose(c->second); + } + RFCCommands.clear(); +} + void CommandParser::RemoveCommand(Commandtable::iterator safei, const char* source) { Command* x = safei->second; |