diff options
-rw-r--r-- | src/cpp/server/dynamic_thread_pool.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/cpp/server/dynamic_thread_pool.cc b/src/cpp/server/dynamic_thread_pool.cc index 7e9b01143a..f58d0420df 100644 --- a/src/cpp/server/dynamic_thread_pool.cc +++ b/src/cpp/server/dynamic_thread_pool.cc @@ -95,9 +95,8 @@ DynamicThreadPool::DynamicThreadPool(int reserve_threads) : } void DynamicThreadPool::ReapThreads(std::list<DynamicThread*>* tlist) { - for (auto t = tlist->begin(); t != tlist->end(); t++) { - delete *t; - t = tlist->erase(t); + for (auto t = tlist->begin(); t != tlist->end(); t = tlist->erase(t)) { + delete *t; } } |