mirror of https://github.com/axmolengine/axmol.git
issues #2774:AssetsManager Test downloading progress label not sync with actual download.
This commit is contained in:
parent
4509a4746a
commit
cafe930026
|
@ -564,7 +564,22 @@ void AssetsManager::Helper::update(float dt)
|
|||
_messageQueueMutex.unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
//remove unnecessary message
|
||||
std::list<Message*>::iterator it;
|
||||
Message *proMsg = nullptr;
|
||||
for (it = _messageQueue->begin(); it != _messageQueue->end(); ++it)
|
||||
{
|
||||
if((*it)->what == ASSETSMANAGER_MESSAGE_PROGRESS)
|
||||
{
|
||||
if (proMsg)
|
||||
{
|
||||
_messageQueue->remove(proMsg);
|
||||
delete (ProgressMessage*)proMsg->obj;
|
||||
delete proMsg;
|
||||
}
|
||||
proMsg = *it;
|
||||
}
|
||||
}
|
||||
// Gets message
|
||||
msg = *(_messageQueue->begin());
|
||||
_messageQueue->pop_front();
|
||||
|
|
Loading…
Reference in New Issue