From 861d5d67ba5b52cbf702f16d4b13aef4a772d287 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 30 Aug 2019 16:29:02 -0700 Subject: [core] add sources to source collection before triggering load --- src/mbgl/style/style_impl.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mbgl/style/style_impl.cpp b/src/mbgl/style/style_impl.cpp index 10fee73cdd..d3298c5cac 100644 --- a/src/mbgl/style/style_impl.cpp +++ b/src/mbgl/style/style_impl.cpp @@ -140,9 +140,8 @@ void Style::Impl::addSource(std::unique_ptr source) { } source->setObserver(this); - source->loadDescription(fileSource); - - sources.add(std::move(source)); + auto item = sources.add(std::move(source)); + item->loadDescription(fileSource); } std::unique_ptr Style::Impl::removeSource(const std::string& id) { -- cgit v1.2.1