From 592ae64ee512d730d798b9342d61d15bb33dedab Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Sun, 4 May 2014 20:44:15 +0200 Subject: 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 --- src/controls/qquickmenu.cpp | 3 +++ 1 file changed, 3 insertions(+) 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; } -- cgit v1.2.1