mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
Fixed CID 1288858
This commit is contained in:
@@ -25,9 +25,13 @@ CThreadHelper::CThreadHelper(std::vector<std::function<void()> > *Tasks, int Thr
|
|||||||
void CThreadHelper::run()
|
void CThreadHelper::run()
|
||||||
{
|
{
|
||||||
boost::thread_group grupa;
|
boost::thread_group grupa;
|
||||||
|
std::vector<boost::thread *> thr;
|
||||||
for(int i=0;i<threads;i++)
|
for(int i=0;i<threads;i++)
|
||||||
grupa.create_thread(std::bind(&CThreadHelper::processTasks,this));
|
thr.push_back(grupa.create_thread(std::bind(&CThreadHelper::processTasks,this)));
|
||||||
grupa.join_all();
|
grupa.join_all();
|
||||||
|
|
||||||
|
for(auto thread : thr)
|
||||||
|
delete thread;
|
||||||
}
|
}
|
||||||
void CThreadHelper::processTasks()
|
void CThreadHelper::processTasks()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user