aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-06-15 14:10:23 +0200
committerUlf Hermann <ulf.hermann@qt.io>2021-06-15 13:27:21 +0000
commit5f3eec895639aeadc187a641a293895f52b51147 (patch)
tree6880499da246cd8ee2e0eb9ff1415d866dbd6071
parentc2d16c5fdc060f437e6cbee15bfa17c8a7f4ffe2 (diff)
QQuickPopup: finalizeExitTransition before deleting internals
Otherwise they get re-created and leak. Pick-to: 6.2 Change-Id: Ib6af70bed196d3b32faa1df7f40063a38e321987 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--src/quicktemplates2/qquickpopup.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp
index 44d0d8f4..ebb85c12 100644
--- a/src/quicktemplates2/qquickpopup.cpp
+++ b/src/quicktemplates2/qquickpopup.cpp
@@ -875,16 +875,17 @@ QQuickPopup::~QQuickPopup()
Q_D(QQuickPopup);
setParentItem(nullptr);
d->popupItem->ungrabShortcut();
- delete d->popupItem;
- d->popupItem = nullptr;
- delete d->positioner;
- d->positioner = nullptr;
// If the popup is destroyed before the exit transition finishes,
// the necessary cleanup (removing modal dimmers that block mouse events,
// emitting closed signal, etc.) won't happen. That's why we do it manually here.
if (d->transitionState == QQuickPopupPrivate::ExitTransition && d->transitionManager.isRunning())
d->finalizeExitTransition();
+
+ delete d->popupItem;
+ d->popupItem = nullptr;
+ delete d->positioner;
+ d->positioner = nullptr;
}
/*!