diff --git a/implementation/routing/include/remote_subscription.hpp b/implementation/routing/include/remote_subscription.hpp index a770a56f7..f791a79d7 100644 --- a/implementation/routing/include/remote_subscription.hpp +++ b/implementation/routing/include/remote_subscription.hpp @@ -99,6 +99,7 @@ class remote_subscription { void set_expired(); bool is_forwarded() const; void set_forwarded(); + void clear_destiny(); private: std::atomic id_; diff --git a/implementation/routing/src/remote_subscription.cpp b/implementation/routing/src/remote_subscription.cpp index 7f5a1044d..a22723a0d 100644 --- a/implementation/routing/src/remote_subscription.cpp +++ b/implementation/routing/src/remote_subscription.cpp @@ -357,4 +357,8 @@ void remote_subscription::set_forwarded() { this->final_destination_.store(destiny::forward, std::memory_order_release); } +void remote_subscription::clear_destiny() { + this->final_destination_.store(destiny::none, std::memory_order_release); +} + } // namespace vsomeip_v3 diff --git a/implementation/routing/src/routing_manager_impl.cpp b/implementation/routing/src/routing_manager_impl.cpp index aed605e51..46ce34992 100644 --- a/implementation/routing/src/routing_manager_impl.cpp +++ b/implementation/routing/src/routing_manager_impl.cpp @@ -2991,6 +2991,7 @@ void routing_manager_impl::on_remote_subscribe( its_update_lock.unlock(); _callback(_subscription); + _subscription->clear_destiny(); return; } @@ -3003,6 +3004,7 @@ void routing_manager_impl::on_remote_subscribe( its_service, its_instance, its_eventgroup, its_major, _subscription->get_clients(), its_id); } + _subscription->clear_destiny(); } void routing_manager_impl::on_remote_unsubscribe(