From 163c515783877b8b0ffb8b5c1bab288addee9745 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Fri, 22 Sep 2017 10:18:08 +0200 Subject: Fix use-after-free when clear()ing all elements from a ListModel Same problem as the problem with remove(), so now clear will call into remove to do the correct thing. See also e29ffa179e9920443a23e2fcb3f0694df32e8a68. [ChangeLog][Qt][Qml] Fix possible use-after-free when clearing all items from a ListModel through JavaScript. Change-Id: Ib9389d80798c4333425b4a49930b1670307d06ac Task-number: QTBUG-59256 Reviewed-by: Simon Hausmann --- src/qml/types/qqmllistmodel_p.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/qml/types/qqmllistmodel_p.h') diff --git a/src/qml/types/qqmllistmodel_p.h b/src/qml/types/qqmllistmodel_p.h index b750d30676..1fda703797 100644 --- a/src/qml/types/qqmllistmodel_p.h +++ b/src/qml/types/qqmllistmodel_p.h @@ -165,6 +165,8 @@ private: void emitItemsInserted(int index, int count); void emitItemsAboutToBeMoved(int from, int to, int n); void emitItemsMoved(int from, int to, int n); + + void removeElements(int index, int removeCount); }; // ### FIXME -- cgit v1.2.3