summaryrefslogtreecommitdiffstats
path: root/src/network/access/qnetworkaccessmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/access/qnetworkaccessmanager.cpp')
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index 6a701afc68..f2dc1839b6 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -1014,7 +1014,8 @@ void QNetworkAccessManagerPrivate::_q_replyFinished()
// If there are no active requests, release our reference to the network session.
// It will not be destroyed immediately, but rather when the connection cache is flushed
// after 2 minutes.
- if (networkSession && q->findChildren<QNetworkReply *>().count() == 1)
+ activeReplyCount--;
+ if (networkSession && activeReplyCount == 0)
networkSession.clear();
#endif
}
@@ -1041,6 +1042,9 @@ QNetworkReply *QNetworkAccessManagerPrivate::postProcess(QNetworkReply *reply)
* avoid getting a connection error. */
q->connect(reply, SIGNAL(sslErrors(QList<QSslError>)), SLOT(_q_replySslErrors(QList<QSslError>)));
#endif
+#ifndef QT_NO_BEARERMANAGEMENT
+ activeReplyCount++;
+#endif
return reply;
}