diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-10-24 11:46:45 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-10-24 11:46:45 -0700 |
commit | 923114628bf4eb9d2756568778bbe0453a55827d (patch) | |
tree | f43ab5ccda3934ca452738f86181460af55cc397 | |
parent | 4b2e1cddb4645fb6d2c5f9634dbeb7c21516cede (diff) | |
download | qtlocation-mapboxgl-upstream/fix-10160.tar.gz |
[core] Add layer before notifying observerupstream/fix-10160
-rw-r--r-- | src/mbgl/style/style_impl.cpp | 3 |
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) { |