From e0334d05c00cfe6140ac55f8b6aa8ee83795b940 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 30 Sep 2019 13:24:57 +0200 Subject: Don't leak the context property in tst_qqmllanguage::accessDeletedObject Change-Id: I27baef97537bb8fda7fcc00d934f0b2568b4284e Reviewed-by: Fabian Kosmale Reviewed-by: Simon Hausmann --- tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 creator(new ObjectCreator); + engine.rootContext()->setContextProperty("objectCreator", creator.get()); QQmlComponent component(&engine, testFileUrl("accessDeletedObject.qml")); VERIFY_ERRORS(0); -- cgit v1.2.3