diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-11-25 14:38:45 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-11-25 14:44:29 (GMT) |
commit | 7f2f38d48b58b6b1ef90198bf2d03422826a5b08 (patch) | |
tree | 697637ed2bf8e250ef0bcc7a225ee3e4366c6381 /src/gui/widgets/qmenu_mac.mm | |
parent | 8ebc15eb2768fab8a9e746785e0c67efb4ace02b (diff) | |
download | Qt-7f2f38d48b58b6b1ef90198bf2d03422826a5b08.zip Qt-7f2f38d48b58b6b1ef90198bf2d03422826a5b08.tar.gz Qt-7f2f38d48b58b6b1ef90198bf2d03422826a5b08.tar.bz2 |
Cocoa: 'Quit' in menu bar does not work
If you have two window, each with its own menu bar that
has a 'Quit' action, we reuse the quit menu item when
switching between the windows. Now, it we deleteLater one of
the menu bars, the new menubar will update the 'Quit' item
just before deleteLater will come along and remote the update
again. This patch will fix this.
Task-number: QTBUG-4684
Reviewed-by: Prasanth
Diffstat (limited to 'src/gui/widgets/qmenu_mac.mm')
-rw-r--r-- | src/gui/widgets/qmenu_mac.mm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index 9510cc6..8b371e5 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -774,8 +774,12 @@ QMacMenuAction::~QMacMenuAction() && menuItem != [getMenuLoader() quitMenuItem]) { [menuItem setHidden:YES]; } + // Only clear the tag if it points to this action. Since items like + // 'Quit' is being reused, we sometimes end up redirecting the item + // before deleting the assosiated action. + if (action.data() == reinterpret_cast<QAction *>([menuItem tag])) + [menuItem setTag:nil]; } - [menuItem setTag:nil]; [menuItem release]; #endif } |