aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickstackview_p.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quicktemplates2/qquickstackview_p.cpp')
-rw-r--r--src/quicktemplates2/qquickstackview_p.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/quicktemplates2/qquickstackview_p.cpp b/src/quicktemplates2/qquickstackview_p.cpp
index f4405246..0167ad97 100644
--- a/src/quicktemplates2/qquickstackview_p.cpp
+++ b/src/quicktemplates2/qquickstackview_p.cpp
@@ -278,9 +278,13 @@ void QQuickStackViewPrivate::viewItemTransitionFinished(QQuickItemViewTransition
}
if (transitioner->runningJobs.isEmpty()) {
- qDeleteAll(removed);
- removed.clear();
+ // ~QQuickStackElement() emits QQuickStackViewAttached::removed(), which may be used
+ // to modify the stack. Set the status first and make a copy of the destroyable stack
+ // elements to exclude any modifications that may happen during the loop. (QTBUG-62153)
setBusy(false);
+ QList<QQuickStackElement*> elements = removed;
+ removed.clear();
+ qDeleteAll(elements);
}
removing.remove(element);