From cbc5431d62e3fe9166f18395dce3ddf2af0906d3 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 28 Mar 2026 21:32:23 +0000 Subject: Switch modules from reference<> to shared_ptr<> and weak_ptr<>. --- modules/sethost.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/sethost.cpp') diff --git a/modules/sethost.cpp b/modules/sethost.cpp index 278410351..9e1e26784 100644 --- a/modules/sethost.cpp +++ b/modules/sethost.cpp @@ -33,7 +33,7 @@ public: IRCv3::ReplyCapReference cap; CharState hostmap; - CommandSetHost(Module* mod) + CommandSetHost(const WeakModulePtr& mod) : Command(mod, "SETHOST", 1, 2) , cap(mod) { @@ -113,7 +113,7 @@ private: public: ModuleSetHost() : Module(VF_VENDOR | VF_OPTCOMMON, "Adds the /SETHOST command which allows server operators to change the hostname of users.") - , cmd(this) + , cmd(weak_from_this()) { } @@ -126,7 +126,7 @@ public: { // A hostname can not contain NUL, LF, CR, or SPACE. if (chr == 0x00 || chr == 0x0A || chr == 0x0D || chr == 0x20) - throw ModuleException(this, " can not contain character 0x{:02X} ({})", chr, chr); + throw ModuleException(weak_from_this(), " can not contain character 0x{:02X} ({})", chr, chr); newhostmap.set(static_cast(chr)); } std::swap(newhostmap, cmd.hostmap); -- cgit v1.3.1-10-gc9f91