summaryrefslogtreecommitdiff
path: root/src/mbgl/style/style_impl.cpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2019-09-04 02:02:23 +0200
committerDane Springmeyer <springmeyer@users.noreply.github.com>2019-09-03 17:02:23 -0700
commitc7be3d52a709c98e93384bdcabc5cebc7adb9dac (patch)
treeb9d36368491a8e03ecf435215a75a616b7059065 /src/mbgl/style/style_impl.cpp
parent1ef763c98e540b0a347cd59ab040a0449df4a14c (diff)
downloadqtlocation-mapboxgl-c7be3d52a709c98e93384bdcabc5cebc7adb9dac.tar.gz
Always call onSourceLoaded observers (#15548)
* [core] add sources to source collection before triggering load * [test] add testcase for #15514 * [core] also call onSourceLoaded observers when no network request was necessary
Diffstat (limited to 'src/mbgl/style/style_impl.cpp')
-rw-r--r--src/mbgl/style/style_impl.cpp5
1 files 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) {
}
source->setObserver(this);
- source->loadDescription(fileSource);
-
- sources.add(std::move(source));
+ auto item = sources.add(std::move(source));
+ item->loadDescription(fileSource);
}
std::unique_ptr<Source> Style::Impl::removeSource(const std::string& id) {