Skip to content
Snippets Groups Projects
Commit ae724bdb authored by mvelosob's avatar mvelosob
Browse files

[cppcheck] Fixes use after free in AgentReference

parent e53788c0
No related branches found
No related tags found
No related merge requests found
......@@ -121,7 +121,7 @@ void AgentReference::queueAndExecuteAction(std::shared_ptr<Action> action, objec
// Get it referenced
m_currentQueue = q;
// Get our execution promise and future and leave one behind.
std::shared_ptr<std::promise<void>> promiseForThisQueue(m_nextQueueExecutionPromise);
std::shared_ptr<std::promise<void>> promiseForThisQueue = m_nextQueueExecutionPromise;
auto futureForThisQueue = std::move(m_nextQueueExecutionFuture);
// Leave a promise behind for the next queue, and set the future.
m_nextQueueExecutionPromise.reset(new std::promise<void>);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment