diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2017-01-30 17:06:32 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-01-30 15:12:15 +0000 |
commit | a73ca89bfd19c065eb79178ba01b82403548d0f9 (patch) | |
tree | c452feff886d101db57e32f1676c197c2b1ffef0 /src | |
parent | 9a2573ac5d2f91922eb376741ac0194271ca979f (diff) | |
download | qtlocation-a73ca89bfd19c065eb79178ba01b82403548d0f9.tar.gz |
Fix Mapbox GL plugin not rendering when reloaded
The code was using a 'static' flag for checking if rendering
on a separated thread, and thus, force the map refresh. Side effect
is this code path was only accessible once per application run once
the check was performed.
Make the flag a member attribute instead, so the flag is reset
on every new QGeoMapMapboxGLPrivate instance.
Change-Id: I7f2bbf2f0f21e45b9f470976cf8e7878a0f0c6f8
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp index 16b5fb8b..a675f528 100644 --- a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp +++ b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp @@ -91,6 +91,7 @@ public: QTimer m_refresh; bool m_shouldRefresh = true; + bool m_warned = false; SyncStates m_syncState = NoSync; @@ -118,14 +119,13 @@ QSGNode *QGeoMapMapboxGLPrivate::updateSceneGraph(QSGNode *oldNode, QQuickWindow { Q_Q(QGeoMapMapboxGL); - static bool warned; - if (!warned) { + if (!m_warned) { if (window->openglContext()->thread() != QCoreApplication::instance()->thread()) { qWarning() << "Threaded rendering is not supported by Mapbox GL plugin."; QMetaObject::invokeMethod(&m_refresh, "start", Qt::QueuedConnection); } - warned = true; + m_warned = true; } QSGMapboxGLNode *mbglNode = static_cast<QSGMapboxGLNode *>(oldNode); |