summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qmenu_mac.mm
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-04-23 08:12:49 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-04-23 08:15:24 (GMT)
commitfc4c398e323a501331afe13e6bf2a15dd8003cef (patch)
tree784b7c8d6c2ec1cef052d4c51e4f154305d17bc7 /src/gui/widgets/qmenu_mac.mm
parent70bafa8e138d938fd34736c46b015d88b5d7feef (diff)
downloadQt-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.mm2
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];