summaryrefslogtreecommitdiff
path: root/platform/glfw
diff options
context:
space:
mode:
Diffstat (limited to 'platform/glfw')
-rw-r--r--platform/glfw/glfw_renderer_frontend.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/platform/glfw/glfw_renderer_frontend.cpp b/platform/glfw/glfw_renderer_frontend.cpp
index 73205f1c56..9c5320cc78 100644
--- a/platform/glfw/glfw_renderer_frontend.cpp
+++ b/platform/glfw/glfw_renderer_frontend.cpp
@@ -32,7 +32,12 @@ void GLFWRendererFrontend::render() {
mbgl::BackendScope guard { glfwView, 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* GLFWRendererFrontend::getRenderer() {