Skip to content

Commit

Permalink
gazebosim#2724 Fix publication id handling
Browse files Browse the repository at this point in the history
  • Loading branch information
nlamprian committed Aug 10, 2020
1 parent 21db7f2 commit cafa41d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions gazebo/transport/Publisher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,13 @@ void Publisher::SendMessage()
pubDataPtr, std::placeholders::_1), *pubIter);

std::lock_guard<std::mutex> lock2(pubDataPtr->mutex);
if (result > 0)
pubDataPtr->pubIds[*pubIter] = result;
else
pubDataPtr->pubIds.erase(*pubIter);
if (pubDataPtr->pubIds.find(*pubIter) != pubDataPtr->pubIds.end())
{
if (result > 0)
pubDataPtr->pubIds[*pubIter] = result;
else
pubDataPtr->pubIds.erase(*pubIter);
}
}

// Clear the local buffer.
Expand Down

0 comments on commit cafa41d

Please sign in to comment.