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.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index 7e95fc547d..b539ed4d9a 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -1018,9 +1018,6 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
d->initializeSession = false;
}
}
-
- if (d->networkSession)
- d->networkSession->setSessionProperty(QLatin1String("AutoCloseSessionTimeout"), -1);
#endif
QNetworkRequest request = req;
@@ -1113,8 +1110,11 @@ void QNetworkAccessManagerPrivate::_q_replyFinished()
emit q->finished(reply);
#ifndef QT_NO_BEARERMANAGEMENT
+ // 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)
- networkSession->setSessionProperty(QLatin1String("AutoCloseSessionTimeout"), 120000);
+ networkSession.clear();
#endif
}