diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-11-29 14:54:52 +0200 |
---|---|---|
committer | Juha Alanen <juha.alanen@mapbox.com> | 2019-11-29 15:37:49 +0200 |
commit | 3947d5fa98263d3b2b4b319b4f6629daca8c91ff (patch) | |
tree | 6df47ea1d010a6ef73d72c67c9098376a9f1a979 /src/mbgl/style | |
parent | 2e93f1e9823f0994224d6fd6836987a0e5b2d7ff (diff) | |
download | qtlocation-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.cpp | 4 |
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); } }); } |