diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-09 11:09:42 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-09 11:09:42 (GMT) |
commit | 274fbf5c1847ffbee9967064068ee8e23b141198 (patch) | |
tree | eda9f5fd49da728907c10e16a6c0af837fd7c9c5 /src/gui/widgets/qmenu.cpp | |
parent | 64a360f45ab9a1c50ca628cfd6b670b93816c756 (diff) | |
parent | e86eabc78e222d9c46a38940085025dea518aefa (diff) | |
download | Qt-274fbf5c1847ffbee9967064068ee8e23b141198.zip Qt-274fbf5c1847ffbee9967064068ee8e23b141198.tar.gz Qt-274fbf5c1847ffbee9967064068ee8e23b141198.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public:
Generate triggered signal even the action launches menu in Symbian.
Symbian emulator: unload file server so apps can be recompiled.
Clear QFontCache TLS content before nullifying TLS pointer.
Fixed focus and window activation events on Symbian when opening menu.
QTBUG-4887 and other exception safety fixes
Diffstat (limited to 'src/gui/widgets/qmenu.cpp')
-rw-r--r-- | src/gui/widgets/qmenu.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index a9978f9..c7573bf 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -1406,12 +1406,14 @@ QMenu::QMenu(QMenuPrivate &dd, QWidget *parent) QMenu::~QMenu() { Q_D(QMenu); - QHash<QAction *, QWidget *>::iterator it = d->widgetItems.begin(); - for (; it != d->widgetItems.end(); ++it) { - if (QWidget *widget = it.value()) { - QWidgetAction *action = static_cast<QWidgetAction *>(it.key()); - action->releaseWidget(widget); - *it = 0; + if (!d->widgetItems.isEmpty()) { // avoid detach on shared null hash + QHash<QAction *, QWidget *>::iterator it = d->widgetItems.begin(); + for (; it != d->widgetItems.end(); ++it) { + if (QWidget *widget = it.value()) { + QWidgetAction *action = static_cast<QWidgetAction *>(it.key()); + action->releaseWidget(widget); + *it = 0; + } } } |