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/alias.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/alias.cpp') diff --git a/modules/alias.cpp b/modules/alias.cpp index 85d16f2f3..966f519cf 100644 --- a/modules/alias.cpp +++ b/modules/alias.cpp @@ -89,11 +89,11 @@ public: Alias a; a.AliasedCommand = tag->getString("text"); if (a.AliasedCommand.empty()) - throw ModuleException(this, " is empty! at " + tag->source.str()); + throw ModuleException(weak_from_this(), " is empty! at " + tag->source.str()); tag->readString("replace", a.ReplaceFormat, true); if (a.ReplaceFormat.empty()) - throw ModuleException(this, " is empty! at " + tag->source.str()); + throw ModuleException(weak_from_this(), " is empty! at " + tag->source.str()); a.RequiredNick = tag->getString("requires"); a.ServiceOnly = tag->getBool("service"); @@ -115,7 +115,7 @@ public: ModuleAlias() : Module(VF_VENDOR, "Allows the server administrator to define custom channel commands (e.g. !kick) and server commands (e.g. /OPERSERV).") - , botmode(this, "bot") + , botmode(weak_from_this(), "bot") { } @@ -391,7 +391,7 @@ public: void Prioritize() override { // Prioritise after spanningtree so that channel aliases show the alias before the effects. - ServerInstance->Modules.SetPriority(this, I_OnUserPostMessage, PRIORITY_AFTER, "spanningtree"); + ServerInstance->Modules.SetPriority(shared_from_this(), I_OnUserPostMessage, PRIORITY_AFTER, "spanningtree"); } }; -- cgit v1.3.1-10-gc9f91