summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDane Springmeyer <dane@mapbox.com>2019-08-30 16:29:02 -0700
committerDane Springmeyer <dane@mapbox.com>2019-08-30 16:29:02 -0700
commitd4b4e3412eec10d13f260e71377e9e629573203f (patch)
treee1e1c275505227d2d2499b6b56148527517348ba
parentc966c313a88dcd798667d8a7b12ea8ebf4e24fe3 (diff)
downloadqtlocation-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.cpp6
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) {