Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix 2 use-after-free problems in the ListModel
This is a combination of 2 commits that went into 5.9. They cannot be cherry-picked however, because some c++11 constructs were used. Hence this combo commit, which is a squashed version of those two commits that have the c++11 bits replaced by Good Old boilerplate code. Original commit 1 (e29ffa1): Fix use-after-free when removing elements from a ListModel Detaching delegate instances from model items is done after the destruction of said model items. The problem is that after the model item is destroyed, it will emit a change/destroyed signal. As the delegate is still referencing the item, this will result in a use-after-free. To provent that, the items are kept around until after everyone (notably the delegate model) has been notified of the removal. [ChangeLog][Qt][Qml] Fix possible use-after-free when removing items from a ListModel through JavaScript. Original commit 2 (163c515): 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. [ChangeLog][Qt][Qml] Fix possible use-after-free when clearing all items from a ListModel through JavaScript. Task-number: QTBUG-63383 Change-Id: I9a6bdf65da63b33833f18c80e74ad7bb93409627 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
- Loading branch information
Showing
4 changed files
with
68 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters