mirror of
https://github.com/anope/anope.git
synced 2026-06-25 15:46:37 +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:
@@ -63,6 +63,8 @@ class CommandNSResetPass : public Command
|
||||
|
||||
class NSResetPass : public Module
|
||||
{
|
||||
CommandNSResetPass commandnsresetpass;
|
||||
|
||||
public:
|
||||
NSResetPass(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator)
|
||||
{
|
||||
@@ -72,7 +74,7 @@ class NSResetPass : public Module
|
||||
this->SetAuthor("Anope");
|
||||
this->SetType(CORE);
|
||||
|
||||
this->AddCommand(NickServ, new CommandNSResetPass());
|
||||
this->AddCommand(NickServ, &commandnsresetpass);
|
||||
|
||||
ModuleManager::Attach(I_OnPreCommand, this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user