summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qmenu_mac.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/qmenu_mac.mm')
-rw-r--r--src/gui/widgets/qmenu_mac.mm6
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
}