summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhttpthreaddelegate.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-07-04 14:40:10 +0200
committerMarc Mutz <marc.mutz@qt.io>2023-07-04 18:16:37 +0200
commit5b7c8eb9849855fac16d91c47803d0ef16a8e9a8 (patch)
treefa48e7a2b20188b6de114b5ffef2d1750c5ced2e /src/network/access/qhttpthreaddelegate.cpp
parentf0ae4b07ebb3c86a6bc6ca0e375c06cd51f45324 (diff)
QtNetwork: replace clashing statics with lambdas I: downloadBufferDeleter
Detected with -unity-build-batch-size 103. Pick-to: 6.6 6.5 Task-number: QTBUG-115031 Change-Id: Ia67082efbdb3f403a8c8010ec15f9f796f97feb6 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/network/access/qhttpthreaddelegate.cpp')
-rw-r--r--src/network/access/qhttpthreaddelegate.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp
index c5c35d522a..261a1eccd6 100644
--- a/src/network/access/qhttpthreaddelegate.cpp
+++ b/src/network/access/qhttpthreaddelegate.cpp
@@ -567,11 +567,6 @@ void QHttpThreadDelegate::synchronousFinishedWithErrorSlot(QNetworkReply::Networ
httpReply = nullptr;
}
-static void downloadBufferDeleter(char *ptr)
-{
- delete[] ptr;
-}
-
void QHttpThreadDelegate::headerChangedSlot()
{
if (!httpReply)
@@ -592,7 +587,7 @@ void QHttpThreadDelegate::headerChangedSlot()
QT_TRY {
char *buf = new char[httpReply->contentLength()]; // throws if allocation fails
if (buf) {
- downloadBuffer = QSharedPointer<char>(buf, downloadBufferDeleter);
+ downloadBuffer = QSharedPointer<char>(buf, [](auto p) { delete[] p; });
httpReply->setUserProvidedDownloadBuffer(buf);
}
} QT_CATCH(const std::bad_alloc &) {