diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-01-23 13:55:55 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2015-01-26 18:09:42 +0100 |
commit | d8d9c4fbb6047b59b98108d6e3221206aa926ccd (patch) | |
tree | b3e106b3e803b33804247b27f131e53c1d60dc12 /src/plugins/geoservices/mapbox | |
parent | 3a10cee763b98e13dc70e585ff59d0b8e48e60e0 (diff) |
Don't reparent network replies away from their owning network manager
This can cause bad things to happen when the network manager owning
the replies gets deleted. The network manager destructor usually cleans
up it's own replies. When reparenting them away that won't happen, but
the replies might still have pending events and have pointers back
into the network manager.
Change-Id: I1d8330a198e9225a557d127f4a91247bcfa4812f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/plugins/geoservices/mapbox')
-rw-r--r-- | src/plugins/geoservices/mapbox/qgeomapreplymapbox.cpp | 6 | ||||
-rw-r--r-- | src/plugins/geoservices/mapbox/qgeomapreplymapbox.h | 4 |
2 files changed, 2 insertions, 8 deletions
diff --git a/src/plugins/geoservices/mapbox/qgeomapreplymapbox.cpp b/src/plugins/geoservices/mapbox/qgeomapreplymapbox.cpp index 7f080724..cbfa40a4 100644 --- a/src/plugins/geoservices/mapbox/qgeomapreplymapbox.cpp +++ b/src/plugins/geoservices/mapbox/qgeomapreplymapbox.cpp @@ -41,7 +41,6 @@ QGeoMapReplyMapbox::QGeoMapReplyMapbox(QNetworkReply *reply, const QGeoTileSpec connect(m_reply, SIGNAL(finished()), this, SLOT(networkReplyFinished())); connect(m_reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(networkReplyError(QNetworkReply::NetworkError))); - connect(m_reply, SIGNAL(destroyed()), this, SLOT(replyDestroyed())); } QGeoMapReplyMapbox::~QGeoMapReplyMapbox() @@ -65,11 +64,6 @@ QNetworkReply *QGeoMapReplyMapbox::networkReply() const return m_reply; } -void QGeoMapReplyMapbox::replyDestroyed() -{ - m_reply = 0; -} - void QGeoMapReplyMapbox::networkReplyFinished() { if (!m_reply) diff --git a/src/plugins/geoservices/mapbox/qgeomapreplymapbox.h b/src/plugins/geoservices/mapbox/qgeomapreplymapbox.h index ca4ec687..3a42a7b1 100644 --- a/src/plugins/geoservices/mapbox/qgeomapreplymapbox.h +++ b/src/plugins/geoservices/mapbox/qgeomapreplymapbox.h @@ -36,6 +36,7 @@ #include <QtNetwork/QNetworkReply> #include <QtLocation/private/qgeotiledmapreply_p.h> +#include <QtCore/QPointer> QT_BEGIN_NAMESPACE @@ -52,12 +53,11 @@ public: QNetworkReply *networkReply() const; private Q_SLOTS: - void replyDestroyed(); void networkReplyFinished(); void networkReplyError(QNetworkReply::NetworkError error); private: - QNetworkReply *m_reply; + QPointer<QNetworkReply> m_reply; QString m_format; }; |