summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2018-01-09 17:32:17 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2018-01-12 10:52:28 +0000
commit7b8ab37beaafbe27c258a6d80d1914f982dcc9e1 (patch)
treeaa9abcab55956d2af57b0b0acd4618dce93af609
parent444e178a0779f1b0d28e2de1d4dc6a4b228c7a5d (diff)
downloadqtlocation-7b8ab37beaafbe27c258a6d80d1914f982dcc9e1.tar.gz
Fix GeocodeModel getting stuck in Loading status
Caused by a signal emitted before nulling a member Task-number: QTBUG-65498 Change-Id: Iad7ab8b2c6cfc290953191eab71ca9aa645ff499 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--src/location/declarativemaps/qdeclarativegeocodemodel.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeocodemodel.cpp b/src/location/declarativemaps/qdeclarativegeocodemodel.cpp
index 3e2a1aea..e5d0356f 100644
--- a/src/location/declarativemaps/qdeclarativegeocodemodel.cpp
+++ b/src/location/declarativemaps/qdeclarativegeocodemodel.cpp
@@ -382,12 +382,13 @@ void QDeclarativeGeocodeModel::geocodeFinished(QGeoCodeReply *reply)
{
if (reply != reply_ || reply->error() != QGeoCodeReply::NoError)
return;
+
+ reply->deleteLater();
+ reply_ = 0;
int oldCount = declarativeLocations_.count();
setLocations(reply->locations());
setError(NoError, QString());
setStatus(QDeclarativeGeocodeModel::Ready);
- reply->deleteLater();
- reply_ = 0;
emit locationsChanged();
if (oldCount != declarativeLocations_.count())
emit countChanged();
@@ -402,7 +403,9 @@ void QDeclarativeGeocodeModel::geocodeError(QGeoCodeReply *reply,
{
if (reply != reply_)
return;
- Q_UNUSED(error);
+
+ reply->deleteLater();
+ reply_ = 0;
int oldCount = declarativeLocations_.count();
if (oldCount > 0) {
// Reset the model
@@ -412,8 +415,6 @@ void QDeclarativeGeocodeModel::geocodeError(QGeoCodeReply *reply,
}
setError(static_cast<QDeclarativeGeocodeModel::GeocodeError>(error), errorString);
setStatus(QDeclarativeGeocodeModel::Error);
- reply->deleteLater();
- reply_ = 0;
}
/*!