From 1077fcf62e9bf617dfef6b1ce281b53b3bad4916 Mon Sep 17 00:00:00 2001 From: Vibhav Aggarwal Date: Mon, 1 Jul 2024 15:04:38 +0900 Subject: [PATCH] async_manager: minor bug fix pop() function of std::queue destroys the front object so it needs to be moved before returning. Change-Id: I08036b48ec9c6989ea59003ce94c785f721ed378 Signed-off-by: Vibhav Aggarwal --- services/common/include/AsyncManager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/common/include/AsyncManager.h b/services/common/include/AsyncManager.h index 3297323..08bc3c5 100644 --- a/services/common/include/AsyncManager.h +++ b/services/common/include/AsyncManager.h @@ -64,7 +64,7 @@ private: In popFromInput() { std::lock_guard lock(_incoming_queue_mutex); - In &data = _incoming_queue.front(); + In data = std::move(_incoming_queue.front()); _incoming_queue.pop(); @@ -74,7 +74,7 @@ private: Out popFromOutput() { std::lock_guard lock(_outgoing_queue_mutex); - Out &output = _outgoing_queue.front(); + Out output = std::move(_outgoing_queue.front()); _outgoing_queue.pop(); -- 2.34.1