From 9dc5996de04420710cda81f91c1b4ff34ee064f2 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 27 May 2020 10:22:37 +0200 Subject: StackView: fix heap-use-after-free when pushing after clear This patch extends the work done in aaec25a7 to cover all operations. Note also that b94889f4 does a similar thing to this patch and aaec25a7, in that it explicitly ignores operations that are done during the removal of elements. Fixes: QTBUG-84381 Change-Id: Id8bbbded39d8e58bcf0e8eedeb2dde794952333f Reviewed-by: Richard Moe Gustavsen (cherry picked from commit b67cc148693de06370633cddf82a31664004e65c) --- src/quicktemplates2/qquickstackview_p_p.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/quicktemplates2/qquickstackview_p_p.h') diff --git a/src/quicktemplates2/qquickstackview_p_p.h b/src/quicktemplates2/qquickstackview_p_p.h index b687561c..91f74edc 100644 --- a/src/quicktemplates2/qquickstackview_p_p.h +++ b/src/quicktemplates2/qquickstackview_p_p.h @@ -72,6 +72,7 @@ public: } void warn(const QString &error); + void warnOfInterruption(const QString &attemptedOperation); void setCurrentItem(QQuickStackElement *element); @@ -93,7 +94,7 @@ public: void depthChange(int newDepth, int oldDepth); bool busy = false; - bool removingElements = false; + bool modifyingElements = false; QString operation; QJSValue initialItem; QQuickItem *currentItem = nullptr; -- cgit v1.2.3