Coverity указывает на потенциальную утечку памяти в следующем коде.
m_threads.create_thread(boost::bind(&boost::asio::io_service::run, &m_ioService));
Ошибка прикрытия следующая:
CID 223450 (#1 of 1): Resource leak (RESOURCE_LEAK)
8. leaked_storage: Ignoring storage allocated by this->m_threads.create_thread(boost::bind(&run, &this->m_ioService)) leaks it
Код для create_thread выглядит следующим образом:
template<typename F>
thread* create_thread(F threadfunc)
{
boost::lock_guard<shared_mutex> guard(m);
std::auto_ptr<thread> new_thread(new thread(threadfunc));
threads.push_back(new_thread.get());
return new_thread.release();
}
Тип new_thread:
std::auto_ptr<thread> new_thread(new thread(threadfunc));
Тип темы:
std::list<thread*> threads;
Деструктор класса thread_group (который имеет метод create_thread и член потоков) удаляет все потоки:
for(std::list<thread*>::iterator it=threads.begin(),end=threads.end();
it!=end;
++it)
{
delete *it;
}
Исходя из этого, считаете ли вы, что произошла утечка памяти или это ложное утверждение.