From fb5f1c4e83d0c1af1dba5644bcafe828a14df898 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 23 Feb 2011 16:33:24 +0100 Subject: QNAM HTTP: Add qWarning() for double-finished() bug Proper bugfix will come with later commit. --- src/network/access/qhttpthreaddelegate.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp index 16c6c0c..b5cf00a 100644 --- a/src/network/access/qhttpthreaddelegate.cpp +++ b/src/network/access/qhttpthreaddelegate.cpp @@ -325,6 +325,11 @@ void QHttpThreadDelegate::readyReadSlot() void QHttpThreadDelegate::finishedSlot() { + if (!httpReply) { + qWarning() << "QHttpThreadDelegate::finishedSlot: HTTP reply had already been deleted, internal problem. Please report."; + return; + } + // If there is still some data left emit that now while (httpReply->readAnyAvailable()) { pendingDownloadData->fetchAndAddRelease(1); @@ -370,6 +375,11 @@ void QHttpThreadDelegate::synchronousFinishedSlot() void QHttpThreadDelegate::finishedWithErrorSlot(QNetworkReply::NetworkError errorCode, const QString &detail) { + if (!httpReply) { + qWarning() << "QHttpThreadDelegate::finishedWithErrorSlot: HTTP reply had already been deleted, internal problem. Please report."; + return; + } + #ifndef QT_NO_OPENSSL if (ssl) emit sslConfigurationChanged(httpReply->sslConfiguration()); -- cgit v0.12