diff options
Diffstat (limited to 'src/network/access/qnetworkaccesshttpbackend.cpp')
-rw-r--r-- | src/network/access/qnetworkaccesshttpbackend.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp index 4908e0a..120e3a7 100644 --- a/src/network/access/qnetworkaccesshttpbackend.cpp +++ b/src/network/access/qnetworkaccesshttpbackend.cpp @@ -711,8 +711,13 @@ void QNetworkAccessHttpBackend::replyDownloadData(QByteArray d) pendingDownloadData.append(d); d.clear(); - writeDownstreamData(pendingDownloadData); + // We need to usa a copy for calling writeDownstreamData as we could + // possibly recurse into this this function when we call + // appendDownstreamDataSignalEmissions because the user might call + // processEvents() or spin an event loop when this occur. + QByteDataBuffer pendingDownloadDataCopy = pendingDownloadData; pendingDownloadData.clear(); + writeDownstreamData(pendingDownloadDataCopy); } void QNetworkAccessHttpBackend::replyFinished() |