diff options
author | Markus Goetz <Markus.Goetz@nokia.com> | 2010-03-25 13:52:53 (GMT) |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2010-03-25 14:18:03 (GMT) |
commit | 656c02f128c56177c48b3de47f7b1e17dbbfa4d3 (patch) | |
tree | 3994a9241080e2c956cb63c3dd45ef15691e41fc /src/network/access | |
parent | 7ef094777e99010d6c9ca414f7239a70dd96c628 (diff) | |
download | Qt-656c02f128c56177c48b3de47f7b1e17dbbfa4d3.zip Qt-656c02f128c56177c48b3de47f7b1e17dbbfa4d3.tar.gz Qt-656c02f128c56177c48b3de47f7b1e17dbbfa4d3.tar.bz2 |
QNAM HTTP: Fix crazy crash when exiting application
This fixes a crash in tst_qnetworkreply and in some QtWebKit
based browsers.
It was related to adding a QPointer on an already
deleted QHttpNetworkConnection object. By converting
an existing normal pointer to a QPointer we set
it a 0-pointer and are safe.
https://bugs.webkit.org/show_bug.cgi?id=36290
Reviewed-by: joao
Reviewed-by: gabi
Diffstat (limited to 'src/network/access')
-rw-r--r-- | src/network/access/qhttpnetworkconnectionchannel.cpp | 2 | ||||
-rw-r--r-- | src/network/access/qhttpnetworkconnectionchannel_p.h | 2 |
2 files changed, 2 insertions, 2 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..6ec47c1 100644 --- a/src/network/access/qhttpnetworkconnectionchannel_p.h +++ b/src/network/access/qhttpnetworkconnectionchannel_p.h @@ -138,7 +138,7 @@ public: {} void setConnection(QHttpNetworkConnection *c) {connection = c;} - QHttpNetworkConnection *connection; + QPointer<QHttpNetworkConnection> connection; void init(); void close(); |