fix QML property cache leaks of delegate items
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Sun, 13 Feb 2022 18:04:16 +0000 (18:04 +0000)
committerDmitry Shachnev <mitya57@debian.org>
Sun, 13 Feb 2022 18:04:16 +0000 (18:04 +0000)
commit4a3588587a0fc83cbe09cb790f28e8e51010e15b
tree1e790378703bc85377cb51c2eca1410062672d7c
parent02084b923a96318db1ad4d58bb502e809bc9efcd
fix QML property cache leaks of delegate items

Origin: upstream, https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=b2862e2bd84d651c
Last-Update: 2021-01-26

The delegate items are destroyed through an event loop by a call to a
deleteLater(). This, however, doesn't work when the application is
in the process of exiting and the event loop is already closed (i.e.
we're in a stack unwinding part that starts after app.exec()).

Combat this situation by setting a parent of the to-be-deleted object
to some QObject that will be destroyed e.g. QCoreApplication::instance()
before the program finishes. As QObjects clean their children on
destruction, this will make sure that we cleanup the previously leaking
thing regardless of the event loop.

Gbp-Pq: Name fix_qml_property_cache_leaks.patch
src/qmlmodels/qqmldelegatemodel.cpp
tests/auto/quick/qquickview_extra/data/qtbug_87228.qml [new file with mode: 0644]
tests/auto/quick/qquickview_extra/qquickview_extra.pro [new file with mode: 0644]
tests/auto/quick/qquickview_extra/tst_qquickview_extra.cpp [new file with mode: 0644]
tests/auto/quick/quick.pro