summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-03-26 16:12:49 +0100
committerKonstantin Käfer <mail@kkaefer.com>2015-03-26 16:12:49 +0100
commit54cd6a59de44b04acfed178b7cb11e8325bcffaa (patch)
tree93bade4a88b1f878d5ea59edb430ef80de080ebe
parent476683e2be2efb316d749c7bd5d438101a3176ea (diff)
downloadqtlocation-mapboxgl-54cd6a59de44b04acfed178b7cb11e8325bcffaa.tar.gz
make sure that we always have a style object after prepar()
-rw-r--r--src/mbgl/map/map.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp
index aa56ea1e71..a49df01191 100644
--- a/src/mbgl/map/map.cpp
+++ b/src/mbgl/map/map.cpp
@@ -760,7 +760,7 @@ void Map::prepare() {
assert(Environment::currentlyOn(ThreadType::Map));
const auto u = updated.exchange(static_cast<UpdateType>(Update::Nothing));
- if (u & static_cast<UpdateType>(Update::StyleInfo)) {
+ if ((u & static_cast<UpdateType>(Update::StyleInfo)) || !style) {
reloadStyle();
}
if (u & static_cast<UpdateType>(Update::Debug)) {
@@ -810,6 +810,7 @@ void Map::render() {
// Cleanup OpenGL objects that we abandoned since the last render call.
env->performCleanup();
+ assert(style);
assert(painter);
painter->render(*style, activeSources,
state, data->getAnimationTime());