[core] Retain thread pool in GeoJSONSource
Otherwise, the construction of the `Immutable<Source::Impl>` in background thread might never yeld.
This commit is contained in:
committed by
Juha Alanen
parent
2e93f1e982
commit
3947d5fa98
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user