Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

CustomGeometrySource should store shared_ptr to shared threadpool #14411

Closed
ivovandongen opened this issue Apr 12, 2019 · 0 comments · Fixed by #14562
Closed

CustomGeometrySource should store shared_ptr to shared threadpool #14411

ivovandongen opened this issue Apr 12, 2019 · 0 comments · Fixed by #14562
Assignees
Labels
Core The cross-platform C++ core, aka mbgl

Comments

@ivovandongen
Copy link
Contributor

In

loader(std::make_unique<Actor<CustomTileLoader>>(*sharedThreadPool(), options.fetchTileFunction, options.cancelTileFunction)) {
a reference to the shared threadpool is handed to the Actor. This could potentially go wrong if the shared threadpool is destroyed before the source is.

To make it safe, it should probably store a shared pointer to the threadpool like here:

, threadPool(sharedThreadPool())
, converter(std::make_unique<Actor<FeatureConverter>>(*threadPool)) {

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants