Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Reset previous style before creating new one
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jfirebaugh committed May 1, 2015
1 parent 415bc8b commit dac4b7d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mbgl/map/map_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Style>();
style->base = base;
style->loadJSON((const uint8_t *)json.c_str());
Expand Down

0 comments on commit dac4b7d

Please sign in to comment.