diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-07-10 12:44:53 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-07-13 09:37:21 (GMT) |
commit | 839fbd22a602aa4b9fa20e6c302329008c3aab09 (patch) | |
tree | 56011fd0ad0162d6633bcf5d0d58fe301ad726b3 /src | |
parent | d5c71b7ede48fd832145cc3921da77b10772053c (diff) | |
download | Qt-839fbd22a602aa4b9fa20e6c302329008c3aab09.zip Qt-839fbd22a602aa4b9fa20e6c302329008c3aab09.tar.gz Qt-839fbd22a602aa4b9fa20e6c302329008c3aab09.tar.bz2 |
Removed an assert from the QNetworkReply.
It is possible that finished() function will be called several times,
for example if the user calls QNetworkReply::close() as a result of
the authenticationRequired() signal, the connection will be closed
(which results in emitting a finished() signal), and then the
authentication will be cancelled, which will also try to emit the same
signal, however the connection state will already be set to Finished.
The fix is to just make sure if the finished() signal has already been
emitted by checking if the connection state is not Finished or
Aborted.
Reviewed-by: Thiago Macieira
Diffstat (limited to 'src')
-rw-r--r-- | src/network/access/qnetworkreplyimpl.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp index de39970..28319bb 100644 --- a/src/network/access/qnetworkreplyimpl.cpp +++ b/src/network/access/qnetworkreplyimpl.cpp @@ -461,8 +461,8 @@ void QNetworkReplyImplPrivate::appendDownstreamData(QIODevice *data) void QNetworkReplyImplPrivate::finished() { Q_Q(QNetworkReplyImpl); - Q_ASSERT_X(state != Finished, "QNetworkReplyImpl", - "Backend called finished/finishedWithError more than once"); + if (state == Finished || state == Aborted) + return; state = Finished; pendingNotifications.clear(); |