diff options
Diffstat (limited to 'platform/darwin')
-rw-r--r-- | platform/darwin/src/MGLRendererFrontend.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/platform/darwin/src/MGLRendererFrontend.h b/platform/darwin/src/MGLRendererFrontend.h index 2df67ca4e4..c0e03351c6 100644 --- a/platform/darwin/src/MGLRendererFrontend.h +++ b/platform/darwin/src/MGLRendererFrontend.h @@ -49,7 +49,12 @@ public: mbgl::BackendScope guard { mbglBackend, mbgl::BackendScope::ScopeType::Implicit }; - renderer->render(*updateParameters); + // onStyleImageMissing might be called during a render. The user implemented method + // could trigger a call to MGLRenderFrontend#update which overwrites `updateParameters`. + // Copy the shared pointer here so that the parameters aren't destroyed while `render(...)` is + // still using them. + auto updateParameters_ = updateParameters; + renderer->render(*updateParameters_); } mbgl::Renderer* getRenderer() { |