Fix issue #142: Crash keeping a key pressed while we're en menu logic.

We cannot send another Menu::closeAll() request if we are processing
other open/close popup requests. This also fix a crash if we keep the left
or right key pressed to navigate through menus.
This commit is contained in:
David Capello 2012-07-17 23:18:43 -03:00
parent 8764f018c7
commit 25fc113c37

View File

@ -1188,11 +1188,17 @@ void MenuBox::closePopup()
void MenuBox::cancelMenuLoop()
{
Menu* menu = getMenu();
if (menu)
if (menu) {
// Do not close the popup menus if we're already processing
// open/close popup messages.
if (get_base(this)->is_processing)
return;
menu->closeAll();
// Lost focus
Manager::getDefault()->freeFocus();
// Lost focus
Manager::getDefault()->freeFocus();
}
}
void MenuItem::executeClick()