diff options
author | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2020-02-27 11:46:17 +0200 |
---|---|---|
committer | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2020-03-05 17:43:37 +0200 |
commit | 81e116d41a4ea1e3ed0d5e91e06541c3e8855a09 (patch) | |
tree | 79cdee7e5a4ffda6fafcb9f4fce39b5b87682385 /src/mbgl/renderer/render_orchestrator.cpp | |
parent | c5155dcf334a5c5125c065e4447cb8b30989e5e5 (diff) | |
download | qtlocation-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/renderer/render_orchestrator.cpp')
-rw-r--r-- | src/mbgl/renderer/render_orchestrator.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mbgl/renderer/render_orchestrator.cpp b/src/mbgl/renderer/render_orchestrator.cpp index c771bd100b..f00f9ee9be 100644 --- a/src/mbgl/renderer/render_orchestrator.cpp +++ b/src/mbgl/renderer/render_orchestrator.cpp @@ -144,7 +144,10 @@ std::unique_ptr<RenderTree> RenderOrchestrator::createRenderTree( } if (LayerManager::annotationsEnabled) { - updateParameters->annotationManager.updateData(); + auto guard = updateParameters->annotationManager.lock(); + if (updateParameters->annotationManager) { + updateParameters->annotationManager->updateData(); + } } const bool zoomChanged = |