summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp
diff options
context:
space:
mode:
authorThomas Lowe <thomas.lowe@nokia.com>2012-05-18 16:26:27 +1000
committerQt by Nokia <qt-info@nokia.com>2012-05-29 01:47:51 +0200
commitc77d8c17c0264fd902aa0fcd54a435f6a9f216b0 (patch)
tree0375e7dc22ba6f89a91a0b07d1ee5cecaa387b06 /src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp
parent3ad2e9f5e14034f87700717c6ad1d52041088f8e (diff)
downloadqtlocation-c77d8c17c0264fd902aa0fcd54a435f6a9f216b0.tar.gz
Correct destruction of mappingManagerEngine
Use of weakPointer to prevent accessing deleted memory. Plus thread exiting to cause the fetcher and thread to destroy themselves. Additional use of weak pointers to deal with the complexity of the mapping manager destructing before the declarative objects. Task-number: QTBUG-25797 Change-Id: I6a27568580c1a00f7588565ff7e35d63eb5dd785 Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
Diffstat (limited to 'src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp')
-rw-r--r--src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp b/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp
index 3f407e64..f90b1c4a 100644
--- a/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp
+++ b/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp
@@ -196,7 +196,7 @@ QString QGeoTileFetcherNokia::getRequestString(const QGeoTileSpec &spec)
QString QGeoTileFetcherNokia::getLanguageString() const
{
- const QLocale::Language lang = m_engineNokia->locale().language();
+ const QLocale::Language lang = m_engineNokia.data()->locale().language();
// English is the default, where no ln is specified. We hardcode the languages
// here even though the entire list is updated automagically from the server.
// The current languages are Arabic, Chinese, Simplified Chinese, English
@@ -207,7 +207,7 @@ QString QGeoTileFetcherNokia::getLanguageString() const
case QLocale::Arabic:
return "ARA";
case QLocale::Chinese:
- if (QLocale::TraditionalChineseScript == m_engineNokia->locale().script())
+ if (QLocale::TraditionalChineseScript == m_engineNokia.data()->locale().script())
return "CHI";
else
return "CHT";
@@ -241,10 +241,12 @@ QString QGeoTileFetcherNokia::applicationId() const
void QGeoTileFetcherNokia::copyrightsFetched()
{
- QMetaObject::invokeMethod(m_engineNokia,
- "loadCopyrightsDescriptorsFromJson",
- Qt::QueuedConnection,
- Q_ARG(QByteArray, m_copyrightsReply->readAll()));
+ if (m_engineNokia) {
+ QMetaObject::invokeMethod(m_engineNokia.data(),
+ "loadCopyrightsDescriptorsFromJson",
+ Qt::QueuedConnection,
+ Q_ARG(QByteArray, m_copyrightsReply->readAll()));
+ }
}
void QGeoTileFetcherNokia::fetchCopyrightsData()