avoid a potential pop from empty stack
This commit is contained in:
parent
f1f06fe6f5
commit
0043387f49
1 changed files with 5 additions and 2 deletions
|
@ -2432,8 +2432,11 @@ void MenuScreen::stop(int result, bool stopAll)
|
|||
{
|
||||
if (!this->runLoop) {
|
||||
Gui->setTop(this->oldtop);
|
||||
Assert(MenuStack.top() == this);
|
||||
MenuStack.pop();
|
||||
if (MenuStack.top() == this) {
|
||||
MenuStack.pop();
|
||||
} else {
|
||||
DebugPrint("ALARM! A menu we're trying to stop is NOT at the top of the menu stack!!");
|
||||
}
|
||||
if (stopAll) {
|
||||
while (!MenuStack.empty()) {
|
||||
MenuStack.pop();
|
||||
|
|
Loading…
Add table
Reference in a new issue