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

Commit

Permalink
[core] Add layer before notifying observer
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh committed Oct 25, 2017
1 parent 84e0f8a commit 01ed21a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mbgl/style/style_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 01ed21a

Please sign in to comment.