Skip to content

Commit

Permalink
fixup! SDL fix memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sniukalov committed Jun 9, 2020
1 parent dff6e3e commit e62a8eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/include/utils/threads/async_runner.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ class AsyncRunner {
*/
void ClearDelegateQueue();

std::queue<threads::ThreadDelegate*> delegates_queue_;
std::queue<threads::ThreadDelegate*> DelegatesQueue;
DelegatesQueue delegates_queue_;
sync_primitives::ConditionalVariable delegate_notifier_;
sync_primitives::Lock delegates_queue_lock_;
volatile bool stop_flag_;
Expand Down
2 changes: 1 addition & 1 deletion src/components/utils/src/threads/async_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void AsyncRunner::AsyncRunnerDelegate::waitForDelegate() {

void AsyncRunner::AsyncRunnerDelegate::ClearDelegateQueue() {
if (!delegates_queue_.empty()) {
std::queue<threads::ThreadDelegate*> queue_to_delete;
DelegatesQueue queue_to_delete;
delegates_queue_lock_.Acquire();
std::swap(delegates_queue_, queue_to_delete);
delegates_queue_lock_.Release();
Expand Down

0 comments on commit e62a8eb

Please sign in to comment.