diff --git a/ecal/core/src/service/ecal_service_server_impl.cpp b/ecal/core/src/service/ecal_service_server_impl.cpp index 10d2ff6450..10cfc3ecf4 100644 --- a/ecal/core/src/service/ecal_service_server_impl.cpp +++ b/ecal/core/src/service/ecal_service_server_impl.cpp @@ -135,12 +135,6 @@ namespace eCAL { if (!m_created) return(false); - if (m_tcp_server_v0) - m_tcp_server_v0->stop(); - - if (m_tcp_server_v1) - m_tcp_server_v1->stop(); - // reset method callback map { std::lock_guard const lock(m_method_map_sync); @@ -153,6 +147,12 @@ namespace eCAL m_event_callback_map.clear(); } + if (m_tcp_server_v0) + m_tcp_server_v0->stop(); + + if (m_tcp_server_v1) + m_tcp_server_v1->stop(); + // mark as no more created m_created = false;