From fc4c398e323a501331afe13e6bf2a15dd8003cef Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Fri, 23 Apr 2010 10:12:49 +0200 Subject: 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 --- src/gui/widgets/qmenu_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]; -- cgit v0.12