From cca16b459f008f4bfa3189ed27296fe981abbd1f Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 24 Oct 2017 11:46:45 -0700 Subject: [PATCH] [core] Add layer before notifying observer --- src/mbgl/style/style_impl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mbgl/style/style_impl.cpp b/src/mbgl/style/style_impl.cpp index 37907d3f602..3214c6316e4 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, optional } 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 Style::Impl::removeLayer(const std::string& id) {