[core] Keep shared_ptr to thread pool in CustomGeometrySource
CustomGeometrySource should keep strong reference to shared thread pool that is used by CustomTileLoader.
This commit is contained in:
@@ -12,6 +12,7 @@ class OverscaledTileID;
|
||||
class CanonicalTileID;
|
||||
template <class T>
|
||||
class Actor;
|
||||
class ThreadPool;
|
||||
|
||||
namespace style {
|
||||
|
||||
@@ -46,6 +47,7 @@ public:
|
||||
class Impl;
|
||||
const Impl& impl() const;
|
||||
private:
|
||||
std::shared_ptr<ThreadPool> threadPool;
|
||||
std::unique_ptr<Actor<CustomTileLoader>> loader;
|
||||
};
|
||||
|
||||
|
||||
@@ -14,7 +14,8 @@ namespace style {
|
||||
CustomGeometrySource::CustomGeometrySource(std::string id,
|
||||
const CustomGeometrySource::Options options)
|
||||
: Source(makeMutable<CustomGeometrySource::Impl>(std::move(id), options)),
|
||||
loader(std::make_unique<Actor<CustomTileLoader>>(*sharedThreadPool(), options.fetchTileFunction, options.cancelTileFunction)) {
|
||||
threadPool(sharedThreadPool()),
|
||||
loader(std::make_unique<Actor<CustomTileLoader>>(*threadPool, options.fetchTileFunction, options.cancelTileFunction)) {
|
||||
}
|
||||
|
||||
CustomGeometrySource::~CustomGeometrySource() = default;
|
||||
|
||||
Reference in New Issue
Block a user