diff options
-rw-r--r-- | src/mbgl/style/style_impl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mbgl/style/style_impl.cpp b/src/mbgl/style/style_impl.cpp index eadffa02ca..e41acfcf46 100644 --- a/src/mbgl/style/style_impl.cpp +++ b/src/mbgl/style/style_impl.cpp @@ -139,9 +139,9 @@ void Style::Impl::addSource(std::unique_ptr<Source> source) { throw std::runtime_error(msg.c_str()); } - source->loadDescription(fileSource); - source->setObserver(this); - sources.add(std::move(source)); + auto item = sources.add(std::move(source)); + item->setObserver(this); + item->loadDescription(fileSource); } std::unique_ptr<Source> Style::Impl::removeSource(const std::string& id) { |