From 37b8de375bf6145bced8264b280dfd10e114ff3a Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Sun, 16 Mar 2014 19:21:24 +0100 Subject: MenuItem: Don't delete owned bound actions They may be referenced from somewhere else, and there's no reason not to keep them alive while the MenuItem is alive. Task-number: QTBUG-37554 Change-Id: Idaab616c856348c0b7eeb1a2e9fdc5bfc3f8a5fd Reviewed-by: Jens Bache-Wiig Reviewed-by: J-P Nurmi --- src/controls/qquickmenuitem.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src') diff --git a/src/controls/qquickmenuitem.cpp b/src/controls/qquickmenuitem.cpp index 60e06495..0167bebd 100644 --- a/src/controls/qquickmenuitem.cpp +++ b/src/controls/qquickmenuitem.cpp @@ -517,12 +517,7 @@ void QQuickMenuItem::setBoundAction(QQuickAction *a) if (a == m_boundAction) return; - if (m_boundAction) { - if (m_boundAction->parent() == this) - delete m_boundAction; - else - unbindFromAction(m_boundAction); - } + unbindFromAction(m_boundAction); bindToAction(a); emit actionChanged(); -- cgit v1.2.1