summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-01-27 11:34:55 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-01-27 11:37:12 (GMT)
commitb8d29f8ee076beee45cb45e8dfca8f4706d11ebd (patch)
tree84e6dbdba68a93ab3dded03e2f51138b4ac43ddd /src/gui/widgets
parent44e3b8862cb0927637d841d276850fbac1681745 (diff)
downloadQt-b8d29f8ee076beee45cb45e8dfca8f4706d11ebd.zip
Qt-b8d29f8ee076beee45cb45e8dfca8f4706d11ebd.tar.gz
Qt-b8d29f8ee076beee45cb45e8dfca8f4706d11ebd.tar.bz2
Cocoa: qaccessibility test crashes
The reason is that the test first creates a menu bar with an exit item The exit item gets merged into the appmenu (together with a QAction) Then we destroy the menu bar, but leave the exit item in the appmenu untouched. Then we create a new menubar _without_ an exit item macUpdateMenubar will then, at one point, try to access the old exit item's QAction, wich is destroyed a long time ago; crash! This patch will make sure we clear out all actions in the menu bars appmenu when the menubar gets destroyed. Reviewed-by: Prasanth
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qmenu_mac.mm4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm
index cd7f9bd..31bda9a 100644
--- a/src/gui/widgets/qmenu_mac.mm
+++ b/src/gui/widgets/qmenu_mac.mm
@@ -1830,6 +1830,10 @@ void QMenuBarPrivate::macDestroyMenuBar()
mac_menubar = 0;
if (qt_mac_current_menubar.qmenubar == q) {
+#ifdef QT_MAC_USE_COCOA
+ QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader();
+ [loader removeActionsFromAppMenu];
+#endif
extern void qt_event_request_menubarupdate(); //qapplication_mac.cpp
qt_event_request_menubarupdate();
}