From cb988fa985095776adfc90abb3b6048128a54ff8 Mon Sep 17 00:00:00 2001 From: faumaray Date: Thu, 26 Nov 2026 17:10:54 +0300 Subject: [PATCH] fix(test): hold owning ServiceHandle across hot-reload calls in FsmServiceHotReload --- tests/internal/FsmServiceHotReload.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/internal/FsmServiceHotReload.cpp b/tests/internal/FsmServiceHotReload.cpp index 8404c27..f27a0c4 100644 --- a/tests/internal/FsmServiceHotReload.cpp +++ b/tests/internal/FsmServiceHotReload.cpp @@ -50,8 +50,11 @@ namespace struct Work : State { Task run() { - auto& svc = service(); - const int total = svc.accumulate(1); + auto svc = acquire_service(); + if (!svc) { + co_return next(); + } + const int total = (*svc)->accumulate(1); if (total >= 500) { co_return succeed(total); }