diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-07-04 14:40:10 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2023-07-04 18:16:37 +0200 |
commit | 5b7c8eb9849855fac16d91c47803d0ef16a8e9a8 (patch) | |
tree | fa48e7a2b20188b6de114b5ffef2d1750c5ced2e /src/network/access/qhttpthreaddelegate.cpp | |
parent | f0ae4b07ebb3c86a6bc6ca0e375c06cd51f45324 (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.cpp | 7 |
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 &) { |