From dac4b7d3c95f84358bd475e01aae45e2ca52ddc0 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 1 May 2015 16:18:57 -0400 Subject: [PATCH] Reset previous style before creating new one This ensures that the worker threads associated with the style are joined before new worker threads are launched. I don't know exactly why, but it seems to fix #1384. --- src/mbgl/map/map_context.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp index 9e5076ff6..e72a17480 100644 --- a/src/mbgl/map/map_context.cpp +++ b/src/mbgl/map/map_context.cpp @@ -140,6 +140,8 @@ void MapContext::loadStyleJSON(const std::string& json, const std::string& base) assert(Environment::currentlyOn(ThreadType::Map)); sprite.reset(); + style.reset(); + style = util::make_unique