From e39309496cf95a4c7d277e1064ac4d68a6af2b68 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Tue, 12 Nov 2024 12:38:52 +1300 Subject: [PATCH] core: add missing locks in command queue --- src/mavsdk/core/mavlink_command_sender.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mavsdk/core/mavlink_command_sender.cpp b/src/mavsdk/core/mavlink_command_sender.cpp index 81017214a..177305125 100644 --- a/src/mavsdk/core/mavlink_command_sender.cpp +++ b/src/mavsdk/core/mavlink_command_sender.cpp @@ -88,6 +88,7 @@ void MavlinkCommandSender::queue_command_async( CommandIdentification identification = identification_from_command(command); + LockedQueue::Guard work_queue_guard(_work_queue); for (const auto& work : _work_queue) { if (work->identification == identification && callback == nullptr) { if (_command_debugging) { @@ -117,6 +118,7 @@ void MavlinkCommandSender::queue_command_async( CommandIdentification identification = identification_from_command(command); + LockedQueue::Guard work_queue_guard(_work_queue); for (const auto& work : _work_queue) { if (work->identification == identification && callback == nullptr) { if (_command_debugging) {