diff --git a/include/mbgl/style/sources/custom_geometry_source.hpp b/include/mbgl/style/sources/custom_geometry_source.hpp index 9daeeb381..3f29d0c0f 100644 --- a/include/mbgl/style/sources/custom_geometry_source.hpp +++ b/include/mbgl/style/sources/custom_geometry_source.hpp @@ -12,6 +12,7 @@ class OverscaledTileID; class CanonicalTileID; template class Actor; +class ThreadPool; namespace style { @@ -46,6 +47,7 @@ public: class Impl; const Impl& impl() const; private: + std::shared_ptr threadPool; std::unique_ptr> loader; }; diff --git a/src/mbgl/style/sources/custom_geometry_source.cpp b/src/mbgl/style/sources/custom_geometry_source.cpp index 6ce7c1be1..7420be932 100644 --- a/src/mbgl/style/sources/custom_geometry_source.cpp +++ b/src/mbgl/style/sources/custom_geometry_source.cpp @@ -14,7 +14,8 @@ namespace style { CustomGeometrySource::CustomGeometrySource(std::string id, const CustomGeometrySource::Options options) : Source(makeMutable(std::move(id), options)), - loader(std::make_unique>(*sharedThreadPool(), options.fetchTileFunction, options.cancelTileFunction)) { + threadPool(sharedThreadPool()), + loader(std::make_unique>(*threadPool, options.fetchTileFunction, options.cancelTileFunction)) { } CustomGeometrySource::~CustomGeometrySource() = default;