Fix thread list iterator

pull/2647/head
vjpai 10 years ago
parent 02b80549e9
commit 24b3b7e3d4
  1. 5
      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;
}
}

Loading…
Cancel
Save