mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-01 07:06:46 +00:00
fix some MessageBox code that was using deleted pointers sometimes
This commit is contained in:
parent
398a7dc65c
commit
9a01e18b29
1 changed files with 7 additions and 0 deletions
|
@ -15,6 +15,13 @@ void MessageBoxManager::onFrame (float frameDuration)
|
||||||
std::vector<MessageBoxManagerTimer>::iterator it;
|
std::vector<MessageBoxManagerTimer>::iterator it;
|
||||||
for(it = mTimers.begin(); it != mTimers.end();)
|
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;
|
it->current += frameDuration;
|
||||||
if(it->current >= it->max)
|
if(it->current >= it->max)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue