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>
This commit is contained in:
Rachel Powers 2023-07-05 20:05:18 -07:00
parent 4dbcedd03f
commit 965ee5687a
No known key found for this signature in database
GPG Key ID: E10E321EB160949B

View File

@ -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);
}
};