From ed572e6c5d598826927c006d9ae144b4b554e5ab Mon Sep 17 00:00:00 2001 From: sniukalov Date: Thu, 4 Jun 2020 10:23:41 +0300 Subject: [PATCH] fixup! SDL fix memory leaks --- src/components/utils/src/threads/async_runner.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/utils/src/threads/async_runner.cc b/src/components/utils/src/threads/async_runner.cc index e14797fce64..7b9a1feaafd 100644 --- a/src/components/utils/src/threads/async_runner.cc +++ b/src/components/utils/src/threads/async_runner.cc @@ -94,17 +94,17 @@ void AsyncRunner::AsyncRunnerDelegate::waitForDelegate() { void AsyncRunner::AsyncRunnerDelegate::clearDelegateQueue() { if (!delegates_queue_.empty()) { - std::queue empty_queue; + std::queue queue_to_delete; delegates_queue_lock_.Acquire(); - std::swap(delegates_queue_, empty_queue); + std::swap(delegates_queue_, queue_to_delete); delegates_queue_lock_.Release(); do { - auto delegate = empty_queue.front(); - empty_queue.pop(); + auto delegate = queue_to_delete.front(); + queue_to_delete.pop(); if (delegate) { delete delegate; } - } while (!empty_queue.empty()); + } while (!queue_to_delete.empty()); } }