forked from teamnwah/openmw-tes3coop
		
	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; | ||||
|     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) | ||||
|         { | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue