aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-06-15 14:21:08 +0200
committerUlf Hermann <ulf.hermann@qt.io>2021-06-15 22:31:12 +0200
commit3f6ecc32cb8fa1c09e8647384ff3017868962668 (patch)
treef332c63feaf128eb1626dabfaffe1fa2e16f59dc
parent5f3eec895639aeadc187a641a293895f52b51147 (diff)
tst_qquickpopup: Don't leak created objects
Change-Id: Ie1359fb407088adcc91b45ae18c682dda8822a67 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--tests/auto/qquickpopup/tst_qquickpopup.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/qquickpopup/tst_qquickpopup.cpp b/tests/auto/qquickpopup/tst_qquickpopup.cpp
index 7f36da20..9a08c340 100644
--- a/tests/auto/qquickpopup/tst_qquickpopup.cpp
+++ b/tests/auto/qquickpopup/tst_qquickpopup.cpp
@@ -1015,7 +1015,8 @@ void tst_QQuickPopup::componentComplete()
QQmlComponent component(&engine);
component.setData("import QtQuick.Controls; Popup { }", QUrl());
- FriendlyPopup *qmlPopup = static_cast<FriendlyPopup *>(component.beginCreate(engine.rootContext()));
+ QScopedPointer<QObject> o(component.beginCreate(engine.rootContext()));
+ FriendlyPopup *qmlPopup = static_cast<FriendlyPopup *>(o.data());
QVERIFY(qmlPopup);
QVERIFY(!qmlPopup->isComponentComplete());