aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-02-11 16:30:41 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-02-11 16:00:12 +0000
commit00292bca971fbe7023a28c3ccd10947a34ea88f8 (patch)
treef62ee4b87bca7eb3ebbf204d383ee4072a1e9923 /src/templates
parent1cf60c89a8711103a37b0511f4e91ee28d984b45 (diff)
Revert "Fix accessing StackView attached properties via popped item"
This reverts commit 1cf60c89a8711103a37b0511f4e91ee28d984b45. The fix wasn't good. It leaves a dangling pointer around, which makes tst_stackview fail and often crash. Unfortunately the problem wasn't caught by the CI, because it didn't run qmltestcases at all. :) Change-Id: I7348f1b79a45715f8c5abec416e8a9864b0288e1 Task-number: QTBUG-50937 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/templates')
-rw-r--r--src/templates/qquickstackview.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/templates/qquickstackview.cpp b/src/templates/qquickstackview.cpp
index a45612f8..87cbfe31 100644
--- a/src/templates/qquickstackview.cpp
+++ b/src/templates/qquickstackview.cpp
@@ -901,8 +901,7 @@ void QQuickStackAttachedPrivate::itemParentChanged(QQuickItem *item, QQuickItem
QQuickStackView::Status oldStatus = element ? element->status : QQuickStackView::Inactive;
QQuickStackView *newView = qobject_cast<QQuickStackView *>(parent);
- if (newView)
- element = QQuickStackViewPrivate::get(newView)->findElement(item);
+ element = newView ? QQuickStackViewPrivate::get(newView)->findElement(item) : Q_NULLPTR;
int newIndex = element ? element->index : -1;
QQuickStackView::Status newStatus = element ? element->status : QQuickStackView::Inactive;