Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit cca16b4

Browse files
committed
[core] Add layer before notifying observer
1 parent af90446 commit cca16b4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mbgl/style/style_impl.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,10 @@ Layer* Style::Impl::addLayer(std::unique_ptr<Layer> layer, optional<std::string>
204204
}
205205

206206
layer->setObserver(this);
207+
Layer* result = layers.add(std::move(layer), before);
207208
observer->onUpdate();
208209

209-
return layers.add(std::move(layer), before);
210+
return result;
210211
}
211212

212213
std::unique_ptr<Layer> Style::Impl::removeLayer(const std::string& id) {

0 commit comments

Comments
 (0)