From: Vibhav Aggarwal Date: Mon, 1 Jul 2024 06:04:38 +0000 (+0900) Subject: async_manager: minor bug fix X-Git-Tag: accepted/tizen/unified/20240903.110722~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F99%2F313699%2F4;p=platform%2Fcore%2Fapi%2Fsingleo.git 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 --- 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();