@@ -81,7 +81,15 struct MenuBuilder { | |||
|
81 | 81 | void closeMenu() |
|
82 | 82 | { |
|
83 | 83 | if (!m_Menus.isEmpty()) { |
|
84 |
m_Menus.pop() |
|
|
84 | if (auto closedMenu = m_Menus.pop()) { | |
|
85 | // Purge menu : if the closed menu has no entries, we remove it from its parent (the | |
|
86 | // current menu) | |
|
87 | if (auto currMenu = currentMenu()) { | |
|
88 | if (closedMenu->isEmpty()) { | |
|
89 | currMenu->removeAction(closedMenu->menuAction()); | |
|
90 | } | |
|
91 | } | |
|
92 | } | |
|
85 | 93 | } |
|
86 | 94 | } |
|
87 | 95 |
General Comments 0
You need to be logged in to leave comments.
Login now