diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp index 1932d9064..b7533db4a 100644 --- a/src/mbgl/style/style.cpp +++ b/src/mbgl/style/style.cpp @@ -30,7 +30,6 @@ Style::Style(MapData& data_) spriteStore(std::make_unique(data.pixelRatio)), spriteAtlas(std::make_unique(512, 512, data.pixelRatio, *spriteStore)), lineAtlas(std::make_unique(512, 512)), - mtx(std::make_unique()), workers(4) { glyphStore->setObserver(this); spriteStore->setObserver(this); @@ -139,7 +138,7 @@ void Style::cascade() { } void Style::recalculate(float z) { - uv::writelock lock(mtx); + std::lock_guard lock(mtx); for (const auto& source : sources) { source->enabled = false; diff --git a/src/mbgl/style/style.hpp b/src/mbgl/style/style.hpp index dbaf8cf02..e1113b3cd 100644 --- a/src/mbgl/style/style.hpp +++ b/src/mbgl/style/style.hpp @@ -13,6 +13,7 @@ #include #include +#include #include #include @@ -106,7 +107,7 @@ private: std::exception_ptr lastError; - std::unique_ptr mtx; + std::mutex mtx; ZoomHistory zoomHistory; bool hasPendingTransitions = false;