aboutsummaryrefslogtreecommitdiff
path: root/modules/log_sql.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-03-28 21:32:23 +0000
committerGravatar Sadie Powell2026-03-29 00:42:15 +0000
commitcbc5431d62e3fe9166f18395dce3ddf2af0906d3 (patch)
tree48a87fc27dc4826ce0caf4071e2060a9ff9e24c5 /modules/log_sql.cpp
parentMove service code from base to its own header. (diff)
Switch modules from reference<> to shared_ptr<> and weak_ptr<>.
Diffstat (limited to 'modules/log_sql.cpp')
-rw-r--r--modules/log_sql.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/modules/log_sql.cpp b/modules/log_sql.cpp
index aaa505252..cc46c2459 100644
--- a/modules/log_sql.cpp
+++ b/modules/log_sql.cpp
@@ -22,14 +22,14 @@
namespace
{
- Module* thismod;
+ WeakModulePtr thismod;
}
class SQLQuery final
: public SQL::Query
{
public:
- SQLQuery(Module* mod) ATTR_NOT_NULL(2)
+ SQLQuery(const WeakModulePtr& mod)
: SQL::Query(mod)
{
}
@@ -88,7 +88,7 @@ class SQLEngine final
: public Log::Engine
{
public:
- SQLEngine(Module* Creator) ATTR_NOT_NULL(2)
+ SQLEngine(const WeakModulePtr& Creator)
: Log::Engine(Creator, "sql")
{
}
@@ -110,11 +110,10 @@ private:
public:
ModuleLogSQL()
: Module(VF_VENDOR, "Provides the ability to log to a SQL database.")
- , engine(this)
+ , engine(weak_from_this())
{
- thismod = this;
+ thismod = weak_from_this();
}
-
};
MODULE_INIT(ModuleLogSQL)