diff options
| author | Aurélien Brooke <aurelien@bahiasoft.fr> | 2022-12-01 12:08:23 +0100 |
|---|---|---|
| committer | Aurélien Brooke <aurelien@bahiasoft.fr> | 2022-12-12 15:27:47 +0100 |
| commit | b36864061fb36f2bf8cc30ac0b601f3b3e146c26 (patch) | |
| tree | 1069ee4066de21ffcf2fabd10bf6daaa57f8cba8 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | |
| parent | c6e294f7adc5d129e2e6a8ac9375ea537d983381 (diff) | |
QQuickOverlay: fix crash when a Drawer is destroyed
When a Drawer is deleted, the stack looks like this:
1 QQuickOverlayPrivate::removePopup
2 QQuickPopupPrivate::setWindow
3 QQuickPopup::setParentItem
4 QQuickPopup::~QQuickPopup
5 QQuickDrawer::~QQuickDrawer
It means that the QQuickPopup * we receive in
QQuickOverlayPrivate::removePopup() is not a QQuickDrawer * anymore.
Thus, the qobject_cast fails, we don't removeOne(), leave dangling
pointers in allDrawers, leading to a crash later in
QQuickOverlayPrivate::stackingOrderDrawers().
Store the Drawers as a list of QQuickPopup *. We downcast only in
QQuickOverlayPrivate::startDrag().
Pick-to: 6.4
Change-Id: I4840a18dec33426c58612db55937ea5988bf7650
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
0 files changed, 0 insertions, 0 deletions
