issues #2774:AssetsManager Test downloading progress label not sync with actual download.

This commit is contained in:
Dhilan007 2013-09-29 09:48:55 +08:00
parent 4509a4746a
commit cafe930026
1 changed files with 16 additions and 1 deletions

View File

@ -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();