mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 04:08:13 +02:00
protect against bad menu pointer
This commit is contained in:
parent
cdce598c35
commit
4880492d05
1 changed files with 4 additions and 2 deletions
|
@ -402,8 +402,10 @@ MenuWrapper* Menu::addMenu(const QString& menuName, const QString& grouping) {
|
||||||
|
|
||||||
// hook our show/hide for popup menus, so we can keep track of whether or not one
|
// hook our show/hide for popup menus, so we can keep track of whether or not one
|
||||||
// of our submenus is currently showing.
|
// of our submenus is currently showing.
|
||||||
connect(menu->_realMenu, &QMenu::aboutToShow, []() { _isSomeSubmenuShown = true; });
|
if (menu && menu->_realMenu) {
|
||||||
connect(menu->_realMenu, &QMenu::aboutToHide, []() { _isSomeSubmenuShown = false; });
|
connect(menu->_realMenu, &QMenu::aboutToShow, []() { _isSomeSubmenuShown = true; });
|
||||||
|
connect(menu->_realMenu, &QMenu::aboutToHide, []() { _isSomeSubmenuShown = false; });
|
||||||
|
}
|
||||||
|
|
||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue