mirror of
https://github.com/anope/anope.git
synced 2026-07-04 21:53:13 +02:00
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.
This commit is contained in:
@@ -92,14 +92,16 @@ class CommandCSBan : public Command
|
||||
|
||||
class CSBan : public Module
|
||||
{
|
||||
CommandCSBan commandcsban, commandcskb;
|
||||
|
||||
public:
|
||||
CSBan(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator)
|
||||
CSBan(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator), commandcsban("BAN"), commandcskb("KB")
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
this->SetType(CORE);
|
||||
|
||||
this->AddCommand(ChanServ, new CommandCSBan("BAN"));
|
||||
this->AddCommand(ChanServ, new CommandCSBan("KB"));
|
||||
this->AddCommand(ChanServ, &commandcsban);
|
||||
this->AddCommand(ChanServ, &commandcskb);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user