summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@digia.com>2014-03-16 19:21:24 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-18 18:02:00 +0100
commit37b8de375bf6145bced8264b280dfd10e114ff3a (patch)
tree851450a7df0c2e68956aba09d0c9eb307faf2fc9
parent6c734a234e7460108c99c2485ac1f80d8a112f29 (diff)
downloadqtquickcontrols-37b8de375bf6145bced8264b280dfd10e114ff3a.tar.gz
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 <jens.bache-wiig@digia.com> Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
-rw-r--r--src/controls/qquickmenuitem.cpp7
1 files changed, 1 insertions, 6 deletions
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();