diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2010-01-27 11:34:55 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2010-01-27 11:37:12 (GMT) |
commit | b8d29f8ee076beee45cb45e8dfca8f4706d11ebd (patch) | |
tree | 84e6dbdba68a93ab3dded03e2f51138b4ac43ddd /src/gui/kernel/qcocoamenuloader_mac.mm | |
parent | 44e3b8862cb0927637d841d276850fbac1681745 (diff) | |
download | Qt-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/kernel/qcocoamenuloader_mac.mm')
-rw-r--r-- | src/gui/kernel/qcocoamenuloader_mac.mm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/kernel/qcocoamenuloader_mac.mm b/src/gui/kernel/qcocoamenuloader_mac.mm index 9f90cec..18b3772 100644 --- a/src/gui/kernel/qcocoamenuloader_mac.mm +++ b/src/gui/kernel/qcocoamenuloader_mac.mm @@ -110,6 +110,12 @@ QT_USE_NAMESPACE } } +- (void)removeActionsFromAppMenu +{ + for (NSMenuItem *item in [appMenu itemArray]) + [item setTag:nil]; +} + - (void)dealloc { [lastAppSpecificItem release]; |