From 77945d775006c296632c293fb320c5308901d5ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Thu, 10 Sep 2009 14:40:52 +0200 Subject: 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 --- src/network/access/qnetworkreplyimpl.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/network') 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() -- cgit v1.2.3