summaryrefslogtreecommitdiff
path: root/include/command_parse.h
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-13 21:34:29 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-13 21:34:29 +0000
commit37fd031da06761c8a050105b55d73a8ab499fb74 (patch)
tree6709b8882806cfe2a4dd20bdcd0aa5581344955e /include/command_parse.h
parent99064f734b9b1513c1d3b3792d6ea8102aae26e1 (diff)
Remove Command and ModeHandler objects in their destructors; fixes possible pointer leak if a module was not careful when triggering exceptions in its constructor
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11872 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/command_parse.h')
-rw-r--r--include/command_parse.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/include/command_parse.h b/include/command_parse.h
index 10dbef58d..35f5a7b0e 100644
--- a/include/command_parse.h
+++ b/include/command_parse.h
@@ -43,10 +43,6 @@ class CoreExport CommandParser : public classbase
*/
bool ProcessCommand(User *user, std::string &cmd);
- /** Removes a command if the sources match. Used as a helper for
- * safe hash_map delete while iter in RemoveCommands(const char* source).
- */
- void RemoveCommand(nspace::hash_map<std::string,Command*>::iterator safei, Module* source);
public:
@@ -145,16 +141,15 @@ class CoreExport CommandParser : public classbase
*/
void DoLines(User* current, bool one_only = false);
- /** Remove all commands relating to module 'source'.
- * @param source A module which has introduced new commands
- */
- void RemoveCommands(Module* source);
-
/** Add a new command to the commands hash
* @param f The new Command to add to the list
* @return True if the command was added
*/
- bool CreateCommand(Command *f);
+ bool AddCommand(Command *f);
+
+ /** Removes a command.
+ */
+ void RemoveCommand(Command* x);
/** Translate nicknames in a string into UIDs, based on the TranslationType given.
* @param to The translation type to use for the process.