don't do concurrent access to a static member variable

in situations where the renderer is used from multiple threads, this causes memory corruption.

fixes mapbox/node-mapbox-gl-native#7
This commit is contained in:
Konstantin Käfer
2014-10-08 15:27:33 +02:00
parent 36b7bb0c09
commit 91f40daa69
4 changed files with 39 additions and 12 deletions

View File

@@ -554,7 +554,7 @@ void StyleParser::parseStyles(JSVal value, std::map<ClassID, ClassProperties> &s
if (name == "style") {
parseStyle(replaceConstant(itr->value), styles[ClassID::Default]);
} else if (name.compare(0, 6, "style.") == 0 && name.length() > 6) {
const ClassID class_id = ClassDictionary::Lookup(name.substr(6));
const ClassID class_id = ClassDictionary::Get().lookup(name.substr(6));
parseStyle(replaceConstant(itr->value), styles[class_id]);
}
}