aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-09-30 13:24:57 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-09-30 15:11:52 +0000
commite0334d05c00cfe6140ac55f8b6aa8ee83795b940 (patch)
tree6fa383a599d5db99a72ab01eb3b84b78518b1479 /tests
parent224f053eba157fb908f08909d8e2015d76b08295 (diff)
Don't leak the context property in tst_qqmllanguage::accessDeletedObject
Change-Id: I27baef97537bb8fda7fcc00d934f0b2568b4284e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index 007fb5cef2..12ed50137b 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -5075,7 +5075,8 @@ void tst_qqmllanguage::accessDeletedObject()
{
QQmlEngine engine;
- engine.rootContext()->setContextProperty("objectCreator", new ObjectCreator);
+ QScopedPointer<ObjectCreator> creator(new ObjectCreator);
+ engine.rootContext()->setContextProperty("objectCreator", creator.get());
QQmlComponent component(&engine, testFileUrl("accessDeletedObject.qml"));
VERIFY_ERRORS(0);