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/log_json.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'modules/log_json.cpp') diff --git a/modules/log_json.cpp b/modules/log_json.cpp index ca6c11240..cef88619e 100644 --- a/modules/log_json.cpp +++ b/modules/log_json.cpp @@ -116,7 +116,7 @@ class JSONFileEngine final : public Log::Engine { public: - JSONFileEngine(Module* Creator) ATTR_NOT_NULL(2) + JSONFileEngine(const WeakModulePtr& Creator) : Log::Engine(Creator, "json") { } @@ -147,7 +147,7 @@ private: FILE* file; public: - JSONStreamEngine(Module* Creator, const std::string& Name, FILE* fh) ATTR_NOT_NULL(2, 4) + JSONStreamEngine(const WeakModulePtr& Creator, const std::string& Name, FILE* fh) ATTR_NOT_NULL(4) : Log::Engine(Creator, Name) , file(fh) { @@ -170,9 +170,9 @@ private: public: ModuleLogJSON() : Module(VF_VENDOR, "Provides the ability to log to JSON.") - , log(this) - , stderrlog(this, "json-stderr", stderr) - , stdoutlog(this, "json-stdout", stdout) + , log(weak_from_this()) + , stderrlog(weak_from_this(), "json-stderr", stderr) + , stdoutlog(weak_from_this(), "json-stdout", stdout) { } -- cgit v1.3.1-10-gc9f91