diff --git a/extensions/AssetsManager/AssetsManager.cpp b/extensions/AssetsManager/AssetsManager.cpp index a57bbdcc8d..3dbbc80fdc 100644 --- a/extensions/AssetsManager/AssetsManager.cpp +++ b/extensions/AssetsManager/AssetsManager.cpp @@ -564,7 +564,22 @@ void AssetsManager::Helper::update(float dt) _messageQueueMutex.unlock(); return; } - + //remove unnecessary message + std::list::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();