Skip to content

Commit

Permalink
Merge pull request #714 from Dronecode/fix-mission-double-call
Browse files Browse the repository at this point in the history
mission: fix double call of result callback
  • Loading branch information
julianoes authored Apr 2, 2019
2 parents 15b34bc + f70b6dd commit dc0f4cf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugins/mission/mission_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ void MissionImpl::process_mission_ack(const mavlink_message_t &message)
{
std::lock_guard<std::recursive_mutex> lock(_mission_data.mutex);
temp_callback = _mission_data.result_callback;
// For the odd case where mission_ack is processed twice in quick succession
// we need to make sure we only copy the callback once and only get nullptr
// for the subsequent case. Otherwise we might report a result twice and
// upset a caller.
_mission_data.result_callback = nullptr;
}

{
Expand Down

0 comments on commit dc0f4cf

Please sign in to comment.