1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-25 16:43:33 +00:00

fix some MessageBox code that was using deleted pointers sometimes

This commit is contained in:
scrawl 2012-05-16 15:00:20 +02:00
parent 398a7dc65c
commit 9a01e18b29

View File

@ -15,6 +15,13 @@ void MessageBoxManager::onFrame (float frameDuration)
std::vector<MessageBoxManagerTimer>::iterator it;
for(it = mTimers.begin(); it != mTimers.end();)
{
// if this messagebox is already deleted, remove the timer and move on
if (std::find(mMessageBoxes.begin(), mMessageBoxes.end(), it->messageBox) == mMessageBoxes.end())
{
it = mTimers.erase(it);
continue;
}
it->current += frameDuration;
if(it->current >= it->max)
{