From a73ca89bfd19c065eb79178ba01b82403548d0f9 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Mon, 30 Jan 2017 17:06:32 +0200 Subject: 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 --- src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/geoservices/mapboxgl') 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(oldNode); -- cgit v1.2.1