summaryrefslogtreecommitdiff
path: root/src/KingSystem/Utils/Thread/TaskQueueBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/KingSystem/Utils/Thread/TaskQueueBase.cpp')
-rw-r--r--src/KingSystem/Utils/Thread/TaskQueueBase.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/KingSystem/Utils/Thread/TaskQueueBase.cpp b/src/KingSystem/Utils/Thread/TaskQueueBase.cpp
index 0e8853c8..5310726c 100644
--- a/src/KingSystem/Utils/Thread/TaskQueueBase.cpp
+++ b/src/KingSystem/Utils/Thread/TaskQueueBase.cpp
@@ -31,9 +31,9 @@ void TaskQueueBase::clear() {
lock();
// Clear all tasks.
- for (auto it = mActiveTasks.robustBegin(), end = mActiveTasks.robustEnd(); it != end; ++it) {
- mActiveTasks.erase(std::addressof(*it));
- it->onRemove();
+ for (auto& task : mActiveTasks.robustRange()) {
+ mActiveTasks.erase(&task);
+ task.onRemove();
}
mActiveTasks.clear();