summaryrefslogtreecommitdiff
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 09:05:00 -0700
commitba8342a12e332a9caf2a21bb022bbc9f2b2214b3 (patch)
treee519decda2f48f021fbd79611578b8ecbae7d453
parentaf904467582e79d8dbf2a405776a81131ff1fa11 (diff)
downloadqtlocation-mapboxgl-ba8342a12e332a9caf2a21bb022bbc9f2b2214b3.tar.gz
[core] Add layer before notifying observer
-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) {