diff options
| author | 2026-03-28 21:32:23 +0000 | |
|---|---|---|
| committer | 2026-03-29 00:42:15 +0000 | |
| commit | cbc5431d62e3fe9166f18395dce3ddf2af0906d3 (patch) | |
| tree | 48a87fc27dc4826ce0caf4071e2060a9ff9e24c5 /modules/globalload.cpp | |
| parent | Move service code from base to its own header. (diff) | |
Switch modules from reference<> to shared_ptr<> and weak_ptr<>.
Diffstat (limited to 'modules/globalload.cpp')
| -rw-r--r-- | modules/globalload.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/globalload.cpp b/modules/globalload.cpp index 26541cd22..c603f481e 100644 --- a/modules/globalload.cpp +++ b/modules/globalload.cpp @@ -30,7 +30,7 @@ class CommandGLoadModule final : public Command { public: - CommandGLoadModule(Module* Creator) + CommandGLoadModule(const WeakModulePtr& Creator) : Command(Creator, "GLOADMODULE", 1) { access_needed = CmdAccess::OPERATOR; @@ -69,7 +69,7 @@ class CommandGUnloadModule final : public Command { public: - CommandGUnloadModule(Module* Creator) + CommandGUnloadModule(const WeakModulePtr& Creator) : Command(Creator, "GUNLOADMODULE", 1) { access_needed = CmdAccess::OPERATOR; @@ -88,7 +88,7 @@ public: if (InspIRCd::Match(ServerInstance->Config->ServerName, servername)) { - Module* m = ServerInstance->Modules.Find(parameters[0]); + const auto m = ServerInstance->Modules.Find(parameters[0]); if (m) { if (ServerInstance->Modules.Unload(m)) @@ -120,7 +120,7 @@ class CommandGReloadModule final : public Command { public: - CommandGReloadModule(Module* Creator) + CommandGReloadModule(const WeakModulePtr& Creator) : Command(Creator, "GRELOADMODULE", 1) { access_needed = CmdAccess::OPERATOR; @@ -133,7 +133,7 @@ public: if (InspIRCd::Match(ServerInstance->Config->ServerName, servername)) { - Module* m = ServerInstance->Modules.Find(parameters[0]); + const auto m = ServerInstance->Modules.Find(parameters[0]); if (m) { ServerInstance->SNO.WriteToSnoMask('a', "MODULE '{}' GLOBALLY RELOADED BY '{}'", parameters[0], user->nick); @@ -168,9 +168,9 @@ private: public: ModuleGlobalLoad() : Module(VF_VENDOR | VF_COMMON, "Adds the /GLOADMODULE, /GRELOADMODULE, and /GUNLOADMODULE commands which allows server operators to load, reload, and unload modules on remote servers.") - , cmdgloadmodule(this) - , cmdgunloadmodule(this) - , cmdgreloadmodule(this) + , cmdgloadmodule(weak_from_this()) + , cmdgunloadmodule(weak_from_this()) + , cmdgreloadmodule(weak_from_this()) { } }; |
