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.
This commit is contained in:
John Firebaugh
2015-05-01 16:18:57 -04:00
parent 415bc8bb74
commit dac4b7d3c9

View File

@@ -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());