diff options
author | vjpai <vpai@google.com> | 2015-07-23 18:51:03 -0700 |
---|---|---|
committer | vjpai <vpai@google.com> | 2015-07-23 18:51:03 -0700 |
commit | 24b3b7e3d4d0c65cbd729bd29c462765d5a74e34 (patch) | |
tree | 3803b0aa5d0374109e7b1a362657bf2d04f1f934 /src | |
parent | 02b80549e9f6283b29bd4bb4b0b87682c24ba5e3 (diff) |
Fix thread list iterator
Diffstat (limited to 'src')
-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; } } |