From 5ff2110103bf909a820d21fdae85d903c1fc32d9 Mon Sep 17 00:00:00 2001 From: Christopher Wecht Date: Sat, 30 Mar 2019 01:09:23 +0100 Subject: [PATCH] /libros/node_handle: alternative way to fix #838 (#1656) --- clients/roscpp/src/libros/node_handle.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clients/roscpp/src/libros/node_handle.cpp b/clients/roscpp/src/libros/node_handle.cpp index 67caeee7fe..82d094c9db 100644 --- a/clients/roscpp/src/libros/node_handle.cpp +++ b/clients/roscpp/src/libros/node_handle.cpp @@ -68,6 +68,10 @@ class NodeHandleBackingCollection V_SrvCImpl srv_cs_; boost::mutex mutex_; + + // keep shared_ptrs to these managers to avoid assertions. Fixes #838 + TopicManagerPtr keep_alive_topic_manager = TopicManager::instance(); + ServiceManagerPtr keep_alive_service_manager = ServiceManager::instance(); }; NodeHandle::NodeHandle(const std::string& ns, const M_string& remappings)