summaryrefslogtreecommitdiff
path: root/src/mbgl/style
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-11-29 14:54:52 +0200
committerJuha Alanen <juha.alanen@mapbox.com>2019-11-29 15:37:49 +0200
commit3947d5fa98263d3b2b4b319b4f6629daca8c91ff (patch)
tree6df47ea1d010a6ef73d72c67c9098376a9f1a979 /src/mbgl/style
parent2e93f1e9823f0994224d6fd6836987a0e5b2d7ff (diff)
downloadqtlocation-mapboxgl-3947d5fa98263d3b2b4b319b4f6629daca8c91ff.tar.gz
[core] Retain thread pool in GeoJSONSource
Otherwise, the construction of the `Immutable<Source::Impl>` in background thread might never yeld.
Diffstat (limited to 'src/mbgl/style')
-rw-r--r--src/mbgl/style/sources/geojson_source.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mbgl/style/sources/geojson_source.cpp b/src/mbgl/style/sources/geojson_source.cpp
index fc8a563fd4..ea6fb5cc68 100644
--- a/src/mbgl/style/sources/geojson_source.cpp
+++ b/src/mbgl/style/sources/geojson_source.cpp
@@ -19,7 +19,7 @@ Immutable<GeoJSONOptions> GeoJSONOptions::defaultOptions() {
}
GeoJSONSource::GeoJSONSource(std::string id, Immutable<GeoJSONOptions> options)
- : Source(makeMutable<Impl>(std::move(id), std::move(options))) {}
+ : Source(makeMutable<Impl>(std::move(id), std::move(options))), threadPool(Scheduler::GetBackground()) {}
GeoJSONSource::~GeoJSONSource() = default;
@@ -98,7 +98,7 @@ void GeoJSONSource::loadDescription(FileSource& fileSource) {
loaded = true;
observer->onSourceLoaded(*this);
};
- Scheduler::GetBackground()->scheduleAndReplyValue(makeImplInBackground, onImplReady);
+ threadPool->scheduleAndReplyValue(makeImplInBackground, onImplReady);
}
});
}