summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2024-03-19 18:31:28 +0100
committerMarc Mutz <marc.mutz@qt.io>2024-03-20 21:22:12 +0100
commiteefd8ab1e8e4d6afa64e15c017e1e78fd30c7382 (patch)
tree51afe16d13400b7aec88011861298f5b1efca849
parent17d2550ed09c564977d4e9414f60c5514ce4f76a (diff)
tst_QNetworkReply: don't use deleteLater() on QSignalSpies
Turn the QSignalSpy deletions from deferred (via deleteLater()) into immediate ones. This is ok: QSignalSpy is using itself as a context object in QMetaObject::connect(), so the connection thus established to the monitored signal will be atomically severed if either sender or receiver are destroyed. There never was a need to defer deletion of the signal spy, so don't. Found by making QSignalSpy's inheritance from QObject private. Pick-to: 6.7 6.6 6.5 Change-Id: I962d28c3a78f356d234324fed68716f2f1052100 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 51b982d0c8..243ad60c09 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -8829,9 +8829,9 @@ void tst_QNetworkReply::emitErrorForAllReplies() // QTBUG-36890
for (int a = 0; a < urls.size(); ++a) {
QVERIFY(replies.at(a)->isFinished());
QCOMPARE(errorSpies.at(a)->size(), 1);
- errorSpies.at(a)->deleteLater();
+ delete errorSpies.at(a);
QCOMPARE(finishedSpies.at(a)->size(), 1);
- finishedSpies.at(a)->deleteLater();
+ delete finishedSpies.at(a);
replies.at(a)->deleteLater();
}
}