fixed the Memory leaks of async event and async processmessages
This commit is contained in:
parent
99cea2f47a
commit
34894df1fb
|
@ -175,6 +175,21 @@ World::~World()
|
||||||
|
|
||||||
delete this->dataPtr;
|
delete this->dataPtr;
|
||||||
this->dataPtr = nullptr;
|
this->dataPtr = nullptr;
|
||||||
|
////////////////Added by zenglei for Asyn event and processMessages///////////////
|
||||||
|
if (this->dataPtr->event_thread)
|
||||||
|
{
|
||||||
|
this->dataPtr->event_thread->join();
|
||||||
|
delete this->dataPtr->event_thread;
|
||||||
|
this->dataPtr->event_thread = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this->dataPtr->async_processmessages_thread)
|
||||||
|
{
|
||||||
|
this->dataPtr->async_processmessages_thread->join();
|
||||||
|
delete this->dataPtr->async_processmessages_thread;
|
||||||
|
this->dataPtr->async_processmessages_thread = nullptr;
|
||||||
|
}
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////
|
//////////////////////////////////////////////////
|
||||||
|
@ -1352,6 +1367,24 @@ void World::Fini()
|
||||||
delete this->dataPtr->thread;
|
delete this->dataPtr->thread;
|
||||||
this->dataPtr->thread = nullptr;
|
this->dataPtr->thread = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/////////////////Added for asyn event by zenglei/////////////////////
|
||||||
|
|
||||||
|
if (this->dataPtr->event_thread)
|
||||||
|
{
|
||||||
|
this->dataPtr->event_thread->join();
|
||||||
|
delete this->dataPtr->event_thread;
|
||||||
|
this->dataPtr->event_thread = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this->dataPtr->async_processmessages_thread)
|
||||||
|
{
|
||||||
|
this->dataPtr->async_processmessages_thread->join();
|
||||||
|
delete this->dataPtr->async_processmessages_thread;
|
||||||
|
this->dataPtr->async_processmessages_thread = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////
|
//////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue