diff options
author | Dane Springmeyer <dane@mapbox.com> | 2019-08-30 16:29:02 -0700 |
---|---|---|
committer | Dane Springmeyer <dane@mapbox.com> | 2019-08-30 16:29:02 -0700 |
commit | d4b4e3412eec10d13f260e71377e9e629573203f (patch) | |
tree | e1e1c275505227d2d2499b6b56148527517348ba | |
parent | c966c313a88dcd798667d8a7b12ea8ebf4e24fe3 (diff) | |
download | qtlocation-mapboxgl-upstream/delay-source-load.tar.gz |
improved workaround for #15514 without the regression of mapbox/node-mbgl-next#33upstream/delay-source-load
-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) { |