aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRachel Powers <508861+Ryex@users.noreply.github.com>2023-07-05 20:05:18 -0700
committerRachel Powers <508861+Ryex@users.noreply.github.com>2023-07-05 20:05:18 -0700
commit965ee5687a475aa0a7e3756f0e5a7e1db26c6a16 (patch)
treeb3ee82826ae1911aa9d13b2dbd13bac99018e5ad
parent4dbcedd03f6d90a9557cd401c2236f9cda60cf9f (diff)
downloadPrismLauncher-965ee5687a475aa0a7e3756f0e5a7e1db26c6a16.tar.gz
PrismLauncher-965ee5687a475aa0a7e3756f0e5a7e1db26c6a16.tar.bz2
PrismLauncher-965ee5687a475aa0a7e3756f0e5a7e1db26c6a16.zip
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>
-rw-r--r--tests/Task_test.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/Task_test.cpp b/tests/Task_test.cpp
index b6bd7edf..ef7042a5 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);
}
};