diff options
author | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2014-05-04 20:44:15 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-04 22:22:01 +0200 |
commit | 592ae64ee512d730d798b9342d61d15bb33dedab (patch) | |
tree | 14436865efd36102e4a79784a17cbcfc824cb8f8 | |
parent | 1bd60bec33458136efceac6c16abf2bc3976d984 (diff) | |
download | qtquickcontrols-592ae64ee512d730d798b9342d61d15bb33dedab.tar.gz |
Menu: Fix QPA related crash on exit
In QPA world, menus are always referenced by a menu item. (This
is the menu item either on the menu bar or in the parent menu.)
So, the same way that we set the menu item's menu in the menu's
constructor, we must clear it. Specially since qtbase commit
8605f44097a986e10c2ddaf4b4eae0b2331d98d1 which checks for the
menu reference in the menu item's destructor.
Change-Id: Id196fc7c2082dbff1d9006cbd82b7237532c4e3c
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
-rw-r--r-- | src/controls/qquickmenu.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/controls/qquickmenu.cpp b/src/controls/qquickmenu.cpp index bb4c79b6..8982b46c 100644 --- a/src/controls/qquickmenu.cpp +++ b/src/controls/qquickmenu.cpp @@ -268,6 +268,9 @@ QQuickMenu::~QQuickMenu() item->setParentMenu(0); } + if (platformItem()) + platformItem()->setMenu(0); + delete m_platformMenu; m_platformMenu = 0; } |