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/httpd.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'modules/httpd.cpp') diff --git a/modules/httpd.cpp b/modules/httpd.cpp index fd63fb29d..82a113832 100644 --- a/modules/httpd.cpp +++ b/modules/httpd.cpp @@ -400,7 +400,7 @@ class HTTPdAPIImpl final : public HTTPdAPIBase { public: - HTTPdAPIImpl(Module* parent) + HTTPdAPIImpl(const WeakModulePtr& parent) : HTTPdAPIBase(parent) { } @@ -423,9 +423,9 @@ private: public: ModuleHttpServer() : Module(VF_VENDOR, "Allows the server administrator to serve various useful resources over HTTP.") - , APIImpl(this) - , acleventprov(this, "http-acl") - , reqeventprov(this, "http-request") + , APIImpl(weak_from_this()) + , acleventprov(weak_from_this(), "http-acl") + , reqeventprov(weak_from_this(), "http-request") { aclevprov = &acleventprov; reqevprov = &reqeventprov; @@ -452,7 +452,7 @@ public: return MOD_RES_ALLOW; } - void OnUnloadModule(Module* mod) override + void OnUnloadModule(const ModulePtr& mod) override { for (insp::intrusive_list::const_iterator i = sockets.begin(); i != sockets.end(); ) { -- cgit v1.3.1-10-gc9f91