From 84597ef5b275d216c0ac183b989dbbf809781f9f Mon Sep 17 00:00:00 2001 From: Daniel Edwards Date: Tue, 28 Nov 2023 09:27:39 +0100 Subject: [PATCH] -- add handler before informing the time provider implementation about it --- SilKit/source/services/orchestration/TimeProvider.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SilKit/source/services/orchestration/TimeProvider.hpp b/SilKit/source/services/orchestration/TimeProvider.hpp index b4405eaf3..2cd46e953 100755 --- a/SilKit/source/services/orchestration/TimeProvider.hpp +++ b/SilKit/source/services/orchestration/TimeProvider.hpp @@ -106,8 +106,9 @@ auto TimeProvider::TimeProviderName() const -> const std::string& HandlerId TimeProvider::AddNextSimStepHandler(NextSimStepHandler handler) { std::unique_lock lock{_mutex}; + const auto handlerId{_handlers.Add(std::move(handler))}; _currentProvider->OnHandlerAdded(); - return _handlers.Add(std::move(handler)); + return handlerId; } void TimeProvider::RemoveNextSimStepHandler(HandlerId handlerId)