diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2010-04-23 08:12:49 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2010-04-23 08:15:24 (GMT) |
commit | fc4c398e323a501331afe13e6bf2a15dd8003cef (patch) | |
tree | 784b7c8d6c2ec1cef052d4c51e4f154305d17bc7 /src/gui/widgets/qmenu_mac.mm | |
parent | 70bafa8e138d938fd34736c46b015d88b5d7feef (diff) | |
download | Qt-fc4c398e323a501331afe13e6bf2a15dd8003cef.zip Qt-fc4c398e323a501331afe13e6bf2a15dd8003cef.tar.gz Qt-fc4c398e323a501331afe13e6bf2a15dd8003cef.tar.bz2 |
Cocoa: quiting the app from the menubar may cause a crash
This happends if the app creates a menubar and assignes an action
to quit, and the delete the menubar. Under some circumstances the
action is not removed from the quit item, and a crash might occur.
This patch clears the quit action from the menubar for this
condition
Reviewed-by: prasanth
Diffstat (limited to 'src/gui/widgets/qmenu_mac.mm')
-rw-r--r-- | src/gui/widgets/qmenu_mac.mm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index 7645c23..e8400d6 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -1831,7 +1831,7 @@ void QMenuBarPrivate::macDestroyMenuBar() menubars()->remove(tlw); mac_menubar = 0; - if (qt_mac_current_menubar.qmenubar == q) { + if (!qt_mac_current_menubar.qmenubar || qt_mac_current_menubar.qmenubar == q) { #ifdef QT_MAC_USE_COCOA QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader(); [loader removeActionsFromAppMenu]; |