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 ed572e6 commit dff6e3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/include/utils/threads/async_runner.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ class AsyncRunner {
void waitForDelegate();

/**
* @bref clearDelegateQueue delete leftover delegates in the queue
* @bref ClearDelegateQueue delete leftover delegates in the queue
*/
void clearDelegateQueue();
void ClearDelegateQueue();

std::queue<threads::ThreadDelegate*> delegates_queue_;
sync_primitives::ConditionalVariable delegate_notifier_;
Expand Down
5 changes: 3 additions & 2 deletions src/components/utils/src/threads/async_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

#include "utils/threads/async_runner.h"

#include <algorithm>
#include <string>

#include "utils/logger.h"
Expand Down Expand Up @@ -67,7 +68,7 @@ AsyncRunner::~AsyncRunner() {
AsyncRunner::AsyncRunnerDelegate::AsyncRunnerDelegate() : stop_flag_(false) {}

AsyncRunner::AsyncRunnerDelegate::~AsyncRunnerDelegate() {
clearDelegateQueue();
ClearDelegateQueue();
}

void AsyncRunner::AsyncRunnerDelegate::processDelegate() {
Expand All @@ -92,7 +93,7 @@ void AsyncRunner::AsyncRunnerDelegate::waitForDelegate() {
}
}

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

0 comments on commit dff6e3e

Please sign in to comment.