diff --git a/src/cpp/server/dynamic_thread_pool.cc b/src/cpp/server/dynamic_thread_pool.cc index 7e9b01143aa5bcfed2297dac5e9aec00411acec5..f58d0420dfb026ec641766f59e2dddef621c3876 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; } }