From d0ab1d4a9287efffe04cc4646538623f8578d487 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 13 Nov 2023 17:41:21 +0100 Subject: [PATCH] Fix tst_qmltyperegistrar::singletonVersions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don't want to leak memory there and it had a typo. Amends commit ad01abe1a62ea50d19cca2b4ccd799b9a01e3e12. Change-Id: Id2ca7d1c11df54221aef95015d023cbcab0454b9 Reviewed-by: Alexey Edelev Reviewed-by: Olivier De Cannière (cherry picked from commit 8dc1b08a5a7f98ea4bdd54bf88cac435d694ab4a) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit d77a350d78d423ab8894e7a60440fec889e6fd78) --- tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp | 4 ++-- tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp index edb9bdb51d..9c381f0174 100644 --- a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp +++ b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp @@ -566,7 +566,7 @@ void tst_qmltyperegistrar::uncreatable() qmlRegisterTypesAndRevisions("A", 1); } -void tst_qmltyperegistrar::singletonVesions() +void tst_qmltyperegistrar::singletonVersions() { QQmlEngine engine; qmlRegisterTypesAndRevisions("A", 0); @@ -581,7 +581,7 @@ void tst_qmltyperegistrar::singletonVesions() " property QtObject v1: SingletonVesion1\n" "}", QUrl()); QVERIFY2(c.isReady(), qPrintable(c.errorString())); - auto obj = c.create(); + QScopedPointer obj(c.create()); QVERIFY2(!obj->property("v0").isNull(), "Singleton version 0 is not registered"); QVERIFY2(!obj->property("v1").isNull(), "Singleton version 1 is not registered"); } diff --git a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h index fb3d4dd2ac..0011fef10e 100644 --- a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h +++ b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h @@ -593,7 +593,7 @@ private slots: void methodReturnType(); void hasIsConstantInParameters(); void uncreatable(); - void singletonVesions(); + void singletonVersions(); #ifdef QT_QUICK_LIB void foreignRevisionedProperty();