Skip to content

Commit

Permalink
Guard against mutliple calls to invalidate
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
  • Loading branch information
jacobperron committed Sep 16, 2020
1 parent 9cb1776 commit b145c73
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ void
ClientGoalHandle<ActionT>::invalidate(const exceptions::UnawareGoalHandleError & ex)
{
std::lock_guard<std::mutex> guard(handle_mutex_);
// Guard against multiple calls
if (is_invalidated()) {
return;
}
is_result_aware_ = false;
invalidate_exception_ = std::make_exception_ptr(ex);
status_ = GoalStatus::STATUS_UNKNOWN;
Expand Down

0 comments on commit b145c73

Please sign in to comment.