diff options
| author | 2026-03-28 21:32:23 +0000 | |
|---|---|---|
| committer | 2026-03-29 00:42:15 +0000 | |
| commit | cbc5431d62e3fe9166f18395dce3ddf2af0906d3 (patch) | |
| tree | 48a87fc27dc4826ce0caf4071e2060a9ff9e24c5 /modules/ircv3_batch.cpp | |
| parent | Move service code from base to its own header. (diff) | |
| download | inspircd++-cbc5431d62e3fe9166f18395dce3ddf2af0906d3.tar.gz inspircd++-cbc5431d62e3fe9166f18395dce3ddf2af0906d3.tar.bz2 inspircd++-cbc5431d62e3fe9166f18395dce3ddf2af0906d3.zip | |
Switch modules from reference<> to shared_ptr<> and weak_ptr<>.
Diffstat (limited to 'modules/ircv3_batch.cpp')
| -rw-r--r-- | modules/ircv3_batch.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/ircv3_batch.cpp b/modules/ircv3_batch.cpp index 6e88bd322..adffff14d 100644 --- a/modules/ircv3_batch.cpp +++ b/modules/ircv3_batch.cpp @@ -99,7 +99,7 @@ class IRCv3::Batch::ManagerImpl final } public: - ManagerImpl(Module* mod) + ManagerImpl(const WeakModulePtr& mod) : Manager(mod) , cap(mod, "batch") , protoevprov(mod, "BATCH") @@ -190,7 +190,7 @@ private: public: ModuleIRCv3Batch() : Module(VF_VENDOR, "Provides the IRCv3 batch client capability.") - , manager(this) + , manager(weak_from_this()) { } @@ -199,9 +199,9 @@ public: manager.Init(); } - void OnUnloadModule(Module* mod) override + void OnUnloadModule(const ModulePtr& mod) override { - if (mod == this) + if (insp::same_ptr(mod, weak_from_this())) manager.Shutdown(); } |
