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/spanningtree/postcommand.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'modules/spanningtree/postcommand.cpp') diff --git a/modules/spanningtree/postcommand.cpp b/modules/spanningtree/postcommand.cpp index 41cdfa908..b42944b3d 100644 --- a/modules/spanningtree/postcommand.cpp +++ b/modules/spanningtree/postcommand.cpp @@ -69,8 +69,10 @@ void SpanningTreeUtilities::RouteCommand(TreeServer* origin, CommandBase* thiscm } else { - auto* srcmodule = thiscmd->service_creator.ptr(); - if (!(srcmodule->properties & (VF_COMMON | VF_CORE)) && srcmodule != Creator) + // The lock here should always succeed because we were called by routing + // a command from it. + const auto& srcmodule = thiscmd->service_creator.lock(); + if (!(srcmodule->properties & (VF_COMMON | VF_CORE)) && !insp::same_ptr(srcmodule, CreatorPtr)) { ServerInstance->Logs.Normal(MODNAME, "Routed command {} from non-VF_COMMON module {}", command, srcmodule->ModuleFile); -- cgit v1.3.1-10-gc9f91