summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qmenu_mac.mm
diff options
context:
space:
mode:
authorZeno Albisser <zeno.albisser@nokia.com>2011-10-04 18:16:34 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-04 18:31:21 +0200
commitc46f59fadf63b661d8611e5896f09fb85c17a00c (patch)
tree6332727c34a0b3db475bce66b13752fcbfccb3d2 /src/plugins/platforms/cocoa/qmenu_mac.mm
parentb4855d33f0f27323bed40c950eb2cfd8a4342406 (diff)
Cocoa: Fix a variable shadowing issue that caused a crash on mac
Change-Id: I2d5ceb9502c769b5a585cdc6f1053168dfadbf12 Reviewed-on: http://codereview.qt-project.org/6000 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qmenu_mac.mm')
-rw-r--r--src/plugins/platforms/cocoa/qmenu_mac.mm7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/platforms/cocoa/qmenu_mac.mm b/src/plugins/platforms/cocoa/qmenu_mac.mm
index cfedf06daf..f62e4a9fd2 100644
--- a/src/plugins/platforms/cocoa/qmenu_mac.mm
+++ b/src/plugins/platforms/cocoa/qmenu_mac.mm
@@ -755,9 +755,10 @@ void QCocoaMenu::setMenuEnabled(bool enable)
}
}
} else {
- NSMenu *menu = menu;
- for (NSMenuItem *item in [menu itemArray]) {
- [item setEnabled:false];
+ NSMenu *m = menu;
+ for (NSMenuItem *item in [m itemArray]) {
+ if (item)
+ [item setEnabled:false];
}
}
}