summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2015-11-19 17:59:21 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-11-19 17:59:28 -0800
commit462af73b7eab4b568779fc3a13adcca009db84e1 (patch)
tree66d1b277d8902562cafa07e1501eb61480836e87
parent9120c19db206f836f3fddf2c850f4f8f7f97ff0f (diff)
downloadqtlocation-mapboxgl-462af73b7eab4b568779fc3a13adcca009db84e1.tar.gz
[core] Followup fix to #3037
The previous fix resulted in annotations sometimes never being added. This would happen if, during the execution of MapContext::update where Update::Annotations was set, the style itself was loaded but some of its subresources (sprite or sources) were not. #3082 is a follow up issue to make MapContext::update less error-prone.
-rw-r--r--src/mbgl/map/map_context.cpp2
-rw-r--r--src/mbgl/style/style.hpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp
index 0c01c822e7..e7316c235a 100644
--- a/src/mbgl/map/map_context.cpp
+++ b/src/mbgl/map/map_context.cpp
@@ -169,7 +169,7 @@ void MapContext::update() {
data.setAnimationTime(Clock::now());
- if (style->isLoaded() && updateFlags & Update::Annotations) {
+ if (style->loaded && updateFlags & Update::Annotations) {
data.getAnnotationManager()->updateStyle(*style);
updateFlags |= Update::Classes;
}
diff --git a/src/mbgl/style/style.hpp b/src/mbgl/style/style.hpp
index 4eef6cce75..dbaf8cf02c 100644
--- a/src/mbgl/style/style.hpp
+++ b/src/mbgl/style/style.hpp
@@ -100,7 +100,6 @@ private:
void emitTileDataChanged();
void emitResourceLoadingFailed(std::exception_ptr error);
- bool loaded = false;
bool shouldReparsePartialTiles = false;
Observer* observer = nullptr;
@@ -112,6 +111,7 @@ private:
bool hasPendingTransitions = false;
public:
+ bool loaded = false;
Worker workers;
};