From ecfec47c50dae517d8d7da538ac48c77a4f4eab3 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 20 Mar 2024 10:33:07 +0100 Subject: [PATCH] tst_QNetworkReply: use QtCore's QScopedPointerDeleteLater MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... instead of rolling your own. Pick-to: 6.5 Change-Id: I4fee2218eb874bfee34bd3a0abac3f85b0746540 Reviewed-by: MÃ¥rten Nordheim (cherry picked from commit 17d2550ed09c564977d4e9414f60c5514ce4f76a) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit 2f7cdec2c98be9f7fce3849b951a1869e3072a46) --- .../access/qnetworkreply/tst_qnetworkreply.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index 771a078b462..98d4cc37f51 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -6056,14 +6056,6 @@ struct QThreadCleanup } }; -struct QDeleteLaterCleanup -{ - static inline void cleanup(QObject *o) - { - o->deleteLater(); - } -}; - #if QT_CONFIG(networkproxy) void tst_QNetworkReply::httpProxyCommandsSynchronous() { @@ -6075,7 +6067,7 @@ void tst_QNetworkReply::httpProxyCommandsSynchronous() // the server thread, because the client is never returning to the // event loop QScopedPointer serverThread(new QThread); - QScopedPointer proxyServer(new MiniHttpServer(responseToSend, false, serverThread.data())); + QScopedPointer proxyServer(new MiniHttpServer(responseToSend, false, serverThread.data())); QNetworkProxy proxy(QNetworkProxy::HttpProxy, "127.0.0.1", proxyServer->serverPort()); manager.setProxy(proxy); @@ -8278,7 +8270,7 @@ void tst_QNetworkReply::synchronousAuthenticationCache() // the server thread, because the client is never returning to the // event loop QScopedPointer serverThread(new QThread); - QScopedPointer server(new MiniAuthServer(serverThread.data())); + QScopedPointer server(new MiniAuthServer(serverThread.data())); server->doClose = true; //1) URL without credentials, we are not authenticated