From 682831a00c93480e5f04f8d8d706f9791fa50dfd Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 30 Dec 2021 10:44:12 +0100 Subject: [PATCH] tst_qanimationgroup: fix memleaks Silences asan. Pick-to: 6.3 6.2 5.15 Change-Id: I4995d9a6f0d4bb617fbb82b68289f7ad1ec0e96b Reviewed-by: Volker Hilsheimer --- .../animation/qanimationgroup/tst_qanimationgroup.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/auto/corelib/animation/qanimationgroup/tst_qanimationgroup.cpp b/tests/auto/corelib/animation/qanimationgroup/tst_qanimationgroup.cpp index a5cb2c021e..8892a0b1ab 100644 --- a/tests/auto/corelib/animation/qanimationgroup/tst_qanimationgroup.cpp +++ b/tests/auto/corelib/animation/qanimationgroup/tst_qanimationgroup.cpp @@ -290,7 +290,8 @@ void tst_QAnimationGroup::setParentAutoAdd() void tst_QAnimationGroup::beginNestedGroup() { - QAnimationGroup *parent = new QParallelAnimationGroup(); + QParallelAnimationGroup group; + QAnimationGroup *parent = &group; for (int i = 0; i < 10; ++i) { if (i & 1) { @@ -347,7 +348,8 @@ void tst_QAnimationGroup::addChildTwice() void tst_QAnimationGroup::loopWithoutStartValue() { - QAnimationGroup *parent = new QSequentialAnimationGroup(); + QSequentialAnimationGroup group; + QAnimationGroup *parent = &group; QObject o; o.setProperty("ole", 0); QCOMPARE(o.property("ole").toInt(), 0);