diff --git a/fairmq/sdk/DDSSession.cxx b/fairmq/sdk/DDSSession.cxx index affe05bc..af1d4c61 100644 --- a/fairmq/sdk/DDSSession.cxx +++ b/fairmq/sdk/DDSSession.cxx @@ -234,6 +234,11 @@ void DDSSession::SubscribeToCommands(std::functionfDDSCustomCmd.unsubscribe(); +} + void DDSSession::SendCommand(const std::string& cmd) { fImpl->fDDSCustomCmd.send(cmd, ""); } auto operator<<(std::ostream& os, const DDSSession& session) -> std::ostream& diff --git a/fairmq/sdk/DDSSession.h b/fairmq/sdk/DDSSession.h index f3e8202e..6618d396 100644 --- a/fairmq/sdk/DDSSession.h +++ b/fairmq/sdk/DDSSession.h @@ -71,6 +71,7 @@ class DDSSession void StartDDSService(); void SubscribeToCommands(std::function); + void UnsubscribeFromCommands(); void SendCommand(const std::string&); friend auto operator<<(std::ostream& os, const DDSSession& session) -> std::ostream&; diff --git a/fairmq/sdk/Topology.cxx b/fairmq/sdk/Topology.cxx index 0e5ed751..510c116f 100644 --- a/fairmq/sdk/Topology.cxx +++ b/fairmq/sdk/Topology.cxx @@ -182,6 +182,7 @@ void Topology::AddNewStateEntry(uint64_t senderId, const std::string& state) Topology::~Topology() { + fDDSSession.UnsubscribeFromCommands(); { std::lock_guard guard(fMtx); fShutdown = true;