diff --git a/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp b/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp index 3c5d9ed3a9..6c8f3558e6 100644 --- a/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp +++ b/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp @@ -7,6 +7,7 @@ #include #include +#include Q_DECLARE_METATYPE(QAbstractAnimation::State) @@ -928,6 +929,7 @@ void tst_QParallelAnimationGroup::autoAdd() test = static_cast(group.animationAt(0)); test->setParent(0); // remove the last one (with duration = 250) + const auto deleteParentlessObject = qScopeGuard([test] { delete test; }); QCOMPARE(test->group(), static_cast(0)); QCOMPARE(group.duration(), 0); }