summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-10-24 11:46:45 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-10-25 08:27:59 -0700
commit01ed21a3c40d8f1e7b95404fd03162b34dce894d (patch)
treec895fa676dd472981f6ad3ab3e4568ed9576d5ff /src
parent84e0f8a3a0937c2089eb6e7482be052482ad4678 (diff)
downloadqtlocation-mapboxgl-01ed21a3c40d8f1e7b95404fd03162b34dce894d.tar.gz
[core] Add layer before notifying observer
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/style/style_impl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mbgl/style/style_impl.cpp b/src/mbgl/style/style_impl.cpp
index 37907d3f60..3214c6316e 100644
--- a/src/mbgl/style/style_impl.cpp
+++ b/src/mbgl/style/style_impl.cpp
@@ -204,9 +204,10 @@ Layer* Style::Impl::addLayer(std::unique_ptr<Layer> layer, optional<std::string>
}
layer->setObserver(this);
+ Layer* result = layers.add(std::move(layer), before);
observer->onUpdate();
- return layers.add(std::move(layer), before);
+ return result;
}
std::unique_ptr<Layer> Style::Impl::removeLayer(const std::string& id) {