summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-26 10:59:34 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-26 10:59:34 (GMT)
commita8e00ddf3b78566f817ed270e6468421cf5d792b (patch)
treeb9cff1afac6e449adf0a9fed2ac3bce661c7d2f2
parent8c4991d5b034d518dd06dc42c3cc9a7fa9b9e3a1 (diff)
parent34538d1367d248b1f9ef8c6cdf5a74c5f9267160 (diff)
downloadQt-a8e00ddf3b78566f817ed270e6468421cf5d792b.zip
Qt-a8e00ddf3b78566f817ed270e6468421cf5d792b.tar.gz
Qt-a8e00ddf3b78566f817ed270e6468421cf5d792b.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1: QNAM HTTP: Symbian compile fix tst_qnetworkreply: Fix side effect, add another test QNAM HTTP: Fix crazy crash when exiting application
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp2
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel_p.h3
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp13
3 files changed, 15 insertions, 3 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 82bc14f..0804498 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -939,7 +939,7 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket
errorCode = QNetworkReply::UnknownNetworkError;
break;
}
- QPointer<QObject> that = connection;
+ QPointer<QHttpNetworkConnection> that = connection;
QString errorString = connection->d_func()->errorDetail(errorCode, socket, socket->errorString());
if (send2Reply) {
if (reply) {
diff --git a/src/network/access/qhttpnetworkconnectionchannel_p.h b/src/network/access/qhttpnetworkconnectionchannel_p.h
index 5032d2b..4a2f8ad 100644
--- a/src/network/access/qhttpnetworkconnectionchannel_p.h
+++ b/src/network/access/qhttpnetworkconnectionchannel_p.h
@@ -65,6 +65,7 @@
#include <private/qhttpnetworkrequest_p.h>
#include <private/qhttpnetworkreply_p.h>
+#include "qhttpnetworkconnection_p.h"
#ifndef QT_NO_HTTP
@@ -138,7 +139,7 @@ public:
{}
void setConnection(QHttpNetworkConnection *c) {connection = c;}
- QHttpNetworkConnection *connection;
+ QPointer<QHttpNetworkConnection> connection;
void init();
void close();
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index 261e613..71ee2d0 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -275,6 +275,9 @@ private Q_SLOTS:
void ignoreSslErrorsListWithSlot_data();
void ignoreSslErrorsListWithSlot();
#endif
+
+ // NOTE: This test must be last!
+ void parentingRepliesToTheApp();
};
QT_BEGIN_NAMESPACE
@@ -3831,7 +3834,7 @@ void tst_QNetworkReply::httpConnectionCount()
for (int i = 0; i < 10; i++) {
QNetworkRequest request (QUrl("http://127.0.0.1:" + QString::number(server.serverPort()) + "/" + QString::number(i)));
QNetworkReply* reply = manager.get(request);
- reply->setParent(this);
+ reply->setParent(&server);
}
int pendingConnectionCount = 0;
@@ -4105,5 +4108,13 @@ void tst_QNetworkReply::ignoreSslErrorsListWithSlot()
#endif // QT_NO_OPENSSL
+// NOTE: This test must be last testcase in tst_qnetworkreply!
+void tst_QNetworkReply::parentingRepliesToTheApp()
+{
+ QNetworkRequest request (QUrl("http://" + QtNetworkSettings::serverName()));
+ manager.get(request)->setParent(this); // parent to this object
+ manager.get(request)->setParent(qApp); // parent to the app
+}
+
QTEST_MAIN(tst_QNetworkReply)
#include "tst_qnetworkreply.moc"