From 965ee5687a475aa0a7e3756f0e5a7e1db26c6a16 Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Wed, 5 Jul 2023 20:05:18 -0700 Subject: [PATCH] fix(test): task test memory leak *again* - put Big thread on the stack so stack will clean it up. Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> --- tests/Task_test.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/Task_test.cpp b/tests/Task_test.cpp index b6bd7edf2..ef7042a59 100644 --- a/tests/Task_test.cpp +++ b/tests/Task_test.cpp @@ -252,16 +252,15 @@ class TaskTest : public QObject { { QEventLoop loop; - auto thread = new BigConcurrentTaskThread; + BigConcurrentTaskThread thread{}; - connect(thread, &BigConcurrentTaskThread::finished, &loop, &QEventLoop::quit); + connect(&thread, &BigConcurrentTaskThread::finished, &loop, &QEventLoop::quit); - thread->start(); + thread.start(); loop.exec(); - QVERIFY(!thread->passed_the_deadline); - thread->deleteLater(); + QVERIFY(!thread.passed_the_deadline); } };