aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickcombobox.cpp
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2016-09-07 15:49:37 +0200
committerMitch Curtis <mitch.curtis@qt.io>2016-09-12 12:17:23 +0000
commitd99e0764e2fe9bc7e652474b5d70e8b66154b807 (patch)
treedb159cfa9b6c4b4579104475420f12b04dcb98e1 /src/quicktemplates2/qquickcombobox.cpp
parent04779d6db3e8219ebda62de4a6f8e57fa62c0b6a (diff)
Delete replaced delegates after Component.completed() is emitted
This avoids the issue "Object destroyed during incubation" error. A proper fix is still required in the QML engine. Change-Id: I3c168cfe2d8c295662bcb5886e99a0f95748e302 Task-number: QTBUG-50992 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickcombobox.cpp')
-rw-r--r--src/quicktemplates2/qquickcombobox.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quicktemplates2/qquickcombobox.cpp b/src/quicktemplates2/qquickcombobox.cpp
index 00fdd421..a7450d76 100644
--- a/src/quicktemplates2/qquickcombobox.cpp
+++ b/src/quicktemplates2/qquickcombobox.cpp
@@ -627,7 +627,7 @@ void QQuickComboBox::setIndicator(QQuickItem *indicator)
if (d->indicator == indicator)
return;
- delete d->indicator;
+ d->deleteDelegate(d->indicator);
d->indicator = indicator;
if (indicator) {
if (!indicator->parentItem())
@@ -655,7 +655,7 @@ void QQuickComboBox::setPopup(QQuickPopup *popup)
if (d->popup == popup)
return;
- delete d->popup;
+ d->deleteDelegate(d->popup);
if (popup) {
QQuickPopupPrivate::get(popup)->allowVerticalFlip = true;
popup->setClosePolicy(QQuickPopup::CloseOnEscape | QQuickPopup::CloseOnPressOutsideParent);