summaryrefslogtreecommitdiff
path: root/src/mbgl/map
diff options
context:
space:
mode:
authorAlexander Shalamov <alexander.shalamov@mapbox.com>2020-02-27 11:46:17 +0200
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2020-03-05 17:43:37 +0200
commit81e116d41a4ea1e3ed0d5e91e06541c3e8855a09 (patch)
tree79cdee7e5a4ffda6fafcb9f4fce39b5b87682385 /src/mbgl/map
parentc5155dcf334a5c5125c065e4447cb8b30989e5e5 (diff)
downloadqtlocation-mapboxgl-81e116d41a4ea1e3ed0d5e91e06541c3e8855a09.tar.gz
[core] Use weak annotation manager
Map and renderer / orchestrator should be able to run on a separate threads, however, legacy AnnotationManager is shared between Map and Renderer, therefore is not a thread safe. Until AnnotationManager is deprecated and removed from a code-base, use it only via weak pointers.
Diffstat (limited to 'src/mbgl/map')
-rw-r--r--src/mbgl/map/map_impl.cpp38
1 files changed, 18 insertions, 20 deletions
diff --git a/src/mbgl/map/map_impl.cpp b/src/mbgl/map/map_impl.cpp
index af18720916..0edc715134 100644
--- a/src/mbgl/map/map_impl.cpp
+++ b/src/mbgl/map/map_impl.cpp
@@ -48,26 +48,24 @@ void Map::Impl::onUpdate() {
transform.updateTransitions(timePoint);
- UpdateParameters params = {
- style->impl->isLoaded(),
- mode,
- pixelRatio,
- debugOptions,
- timePoint,
- transform.getState(),
- style->impl->getGlyphURL(),
- style->impl->spriteLoaded,
- style->impl->getTransitionOptions(),
- style->impl->getLight()->impl,
- style->impl->getImageImpls(),
- style->impl->getSourceImpls(),
- style->impl->getLayerImpls(),
- annotationManager,
- fileSource,
- prefetchZoomDelta,
- bool(stillImageRequest),
- crossSourceCollisions
- };
+ UpdateParameters params = {style->impl->isLoaded(),
+ mode,
+ pixelRatio,
+ debugOptions,
+ timePoint,
+ transform.getState(),
+ style->impl->getGlyphURL(),
+ style->impl->spriteLoaded,
+ style->impl->getTransitionOptions(),
+ style->impl->getLight()->impl,
+ style->impl->getImageImpls(),
+ style->impl->getSourceImpls(),
+ style->impl->getLayerImpls(),
+ annotationManager.makeWeakPtr(),
+ fileSource,
+ prefetchZoomDelta,
+ bool(stillImageRequest),
+ crossSourceCollisions};
rendererFrontend.update(std::make_shared<UpdateParameters>(std::move(params)));
}