diff options
author | João Abecasis <joao@abecasis.name> | 2009-09-10 14:40:52 +0200 |
---|---|---|
committer | João Abecasis <joao@abecasis.name> | 2009-09-10 14:55:04 +0200 |
commit | 77945d775006c296632c293fb320c5308901d5ec (patch) | |
tree | b71e6e86ad4a3041d3407da6c97c954042b5e48b /src/network | |
parent | ebc0079ee5fa70564816817a2ea4aecd7ff189db (diff) |
Only reset the backend pointer after we're done with it
Since 925912ebf552417306a5bd20fd986afda6a582be QNetworkReplyImplPrivate
no longer holds its own pointer to the network cache and relies on the
backend to get it. Since the cache is used in our call to finished, we
must reset the backend only after that.
This fixes a crash I was seeing in Arora...
Reviewed-by: Markus Goetz
Reviewed-by: Peter Hartmann
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/access/qnetworkreplyimpl.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp index 29bf238a18..87dd19aba2 100644 --- a/src/network/access/qnetworkreplyimpl.cpp +++ b/src/network/access/qnetworkreplyimpl.cpp @@ -540,10 +540,6 @@ void QNetworkReplyImpl::abort() return; // stop both upload and download - if (d->backend) { - d->backend->deleteLater(); - d->backend = 0; - } if (d->outgoingData) disconnect(d->outgoingData, 0, this, 0); if (d->copyDevice) @@ -557,6 +553,12 @@ void QNetworkReplyImpl::abort() d->finished(); } d->state = QNetworkReplyImplPrivate::Aborted; + + // finished may access the backend + if (d->backend) { + d->backend->deleteLater(); + d->backend = 0; + } } void QNetworkReplyImpl::close() |