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/namedmodes.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'modules/namedmodes.cpp') diff --git a/modules/namedmodes.cpp b/modules/namedmodes.cpp index 995ea8e74..817dc5c02 100644 --- a/modules/namedmodes.cpp +++ b/modules/namedmodes.cpp @@ -61,7 +61,7 @@ class CommandProp final : public SplitCommand { public: - CommandProp(Module* parent) + CommandProp(const WeakModulePtr& parent) : SplitCommand(parent, "PROP", 1) { syntax = { " [[(+|-)] []]" }; @@ -113,7 +113,7 @@ class DummyZ final : public ModeHandler { public: - DummyZ(Module* parent) + DummyZ(const WeakModulePtr& parent) : ModeHandler(parent, "namebase", 'Z', PARAM_ALWAYS, MODETYPE_CHANNEL) { list = true; @@ -138,14 +138,14 @@ private: public: ModuleNamedModes() : Module(VF_VENDOR, "Provides support for adding and removing modes via their long names.") - , cmd(this) - , dummyZ(this) + , cmd(weak_from_this()) + , dummyZ(weak_from_this()) { } void Prioritize() override { - ServerInstance->Modules.SetPriority(this, I_OnPreMode, PRIORITY_FIRST); + ServerInstance->Modules.SetPriority(shared_from_this(), I_OnPreMode, PRIORITY_FIRST); } ModResult OnPreMode(User* source, User* dest, Channel* channel, Modes::ChangeList& modes) override -- cgit v1.3.1-10-gc9f91