From c770c47e18121e93bcdd06b1ab5f161440ffcfe2 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 31 Jul 2010 21:37:45 -0400 Subject: Don't dynamically allocate commands in modules anymore, instead made them members of modules. This means the commands are automatically destructed when the module is unloaded. Cleans up some old ugly code. --- include/commands.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include/commands.h') diff --git a/include/commands.h b/include/commands.h index 0c8b7bae1..714d1c48d 100644 --- a/include/commands.h +++ b/include/commands.h @@ -106,9 +106,15 @@ class CoreExport Command : public Flags virtual bool AddSubcommand(Command *c); /** Delete a subcommand from this command - * @param cname The subcommand name + * @param c The command + */ + virtual bool DelSubcommand(Command *c); + + /** Find a subcommand + * @param name The subcommand name + * @return The subcommand */ - virtual bool DelSubcommand(const Anope::string &cname); + virtual Command *FindSubcommand(const Anope::string &name); }; #endif // COMMANDS_H -- cgit