Skip to content

Commit 039a5c0

Browse files
fengjingchao-cnycool
authored andcommitted
fix shm_manager use of resource conflicts
1 parent 29d6b04 commit 039a5c0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ros/ros_comm/roscpp/src/libros/shm_manager.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,14 @@ void ShmManager::shutdown()
118118
void ShmManager::threadFunc()
119119
{
120120
sharedmem_transport::SharedMemoryUtil sharedmem_util;
121-
L_Subscription subs;
122-
L_Subscription::iterator it;
123121
std::string topic;
124122

125123
while (started_ && ros::ok())
126124
{
127125
if (TopicManager::instance()->getNumSubscriptions() > 0)
128126
{
129-
subs = TopicManager::instance()->getAllSubscription();
127+
L_Subscription subs = TopicManager::instance()->getAllSubscription();
128+
L_Subscription::iterator it;
130129
if (!g_config_comm.transport_mode &&
131130
shm_map_.size() < TopicManager::instance()->getNumSubscriptions())
132131
{

0 commit comments

Comments
 (0)