From f4707f72e0ce7f1c40337c72ae5c0c0c8ef0efed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Tue, 26 May 2015 15:18:27 +0200 Subject: Replace mbgl::util::make_unique<> with std::make_unique<> --- android/cpp/native_map_view.cpp | 3 +-- bin/render.cpp | 1 - include/mbgl/platform/default/image_reader.hpp | 2 +- include/mbgl/platform/log.hpp | 1 - include/mbgl/storage/file_source.hpp | 1 - include/mbgl/util/std.hpp | 23 ----------------------- linux/main.cpp | 3 +-- platform/darwin/http_request_nsurl.mm | 9 ++++----- platform/darwin/image.mm | 3 +-- platform/default/asset_request_fs.cpp | 9 ++++----- platform/default/asset_request_zip.cpp | 7 +++---- platform/default/headless_view.cpp | 7 +++---- platform/default/http_request_curl.cpp | 10 +++++----- platform/default/image.cpp | 3 +-- platform/default/image_reader.cpp | 4 ++-- platform/default/sqlite_cache.cpp | 16 ++++++++-------- src/mbgl/geometry/glyph_atlas.cpp | 4 +--- src/mbgl/geometry/line_atlas.cpp | 3 +-- src/mbgl/geometry/sprite_atlas.cpp | 2 +- src/mbgl/map/annotation.cpp | 5 ++--- src/mbgl/map/annotation.hpp | 1 - src/mbgl/map/map.cpp | 5 ++--- src/mbgl/map/map_context.cpp | 19 +++++++++---------- src/mbgl/map/resource_loader.cpp | 2 +- src/mbgl/map/source.cpp | 3 ++- src/mbgl/map/sprite.cpp | 3 +-- src/mbgl/map/tile_parser.cpp | 7 +++---- src/mbgl/map/transform.cpp | 1 - src/mbgl/map/vector_tile_data.cpp | 3 +-- src/mbgl/renderer/fill_bucket.cpp | 5 ++--- src/mbgl/renderer/line_bucket.cpp | 3 +-- src/mbgl/renderer/painter.cpp | 25 ++++++++++++------------- src/mbgl/renderer/painter_fill.cpp | 1 - src/mbgl/renderer/painter_raster.cpp | 1 - src/mbgl/renderer/symbol_bucket.cpp | 3 +-- src/mbgl/shader/shader.cpp | 6 +++--- src/mbgl/storage/default_file_source.cpp | 2 +- src/mbgl/storage/request.cpp | 5 ++--- src/mbgl/style/style.cpp | 3 +-- src/mbgl/style/style_parser.cpp | 1 - src/mbgl/text/glyph_store.cpp | 13 ++++++------- src/mbgl/util/raster.cpp | 3 +-- src/mbgl/util/run_loop.hpp | 3 +-- src/mbgl/util/worker.cpp | 4 ++-- test/api/repeated_render.cpp | 2 +- test/api/set_style.cpp | 2 +- test/headless/headless.cpp | 1 - test/miscellaneous/bilinear.cpp | 3 +-- test/miscellaneous/clip_ids.cpp | 1 - test/resources/mock_file_source.cpp | 2 +- test/resources/mock_file_source.hpp | 1 + test/resources/resource_loader.cpp | 16 ++++++++-------- test/storage/database.cpp | 22 +++++++++++----------- 53 files changed, 115 insertions(+), 173 deletions(-) diff --git a/android/cpp/native_map_view.cpp b/android/cpp/native_map_view.cpp index 03530aefff..1d25442a55 100644 --- a/android/cpp/native_map_view.cpp +++ b/android/cpp/native_map_view.cpp @@ -15,7 +15,6 @@ #include #include #include -#include namespace mbgl { namespace android { @@ -214,7 +213,7 @@ void NativeMapView::initializeDisplay() { throw new std::runtime_error("eglChooseConfig() failed"); } - const std::unique_ptr configs = mbgl::util::make_unique(numConfigs); + const auto configs = std::make_unique(numConfigs); if (!eglChooseConfig(display, configAttribs, configs.get(), numConfigs, &numConfigs)) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglChooseConfig() returned error %d", eglGetError()); throw new std::runtime_error("eglChooseConfig() failed"); diff --git a/bin/render.cpp b/bin/render.cpp index 65cc2e8f43..5ae83c1d48 100644 --- a/bin/render.cpp +++ b/bin/render.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include #include diff --git a/include/mbgl/platform/default/image_reader.hpp b/include/mbgl/platform/default/image_reader.hpp index 985e4874cd..52a67a2830 100644 --- a/include/mbgl/platform/default/image_reader.hpp +++ b/include/mbgl/platform/default/image_reader.hpp @@ -1,11 +1,11 @@ #ifndef MBGL_UTIL_IMAGE_READER_HPP #define MBGL_UTIL_IMAGE_READER_HPP -#include #include // stl #include #include +#include namespace mbgl { namespace util { diff --git a/include/mbgl/platform/log.hpp b/include/mbgl/platform/log.hpp index d6f3cd1ab4..86a8cdbef1 100644 --- a/include/mbgl/platform/log.hpp +++ b/include/mbgl/platform/log.hpp @@ -3,7 +3,6 @@ #include -#include #include #include diff --git a/include/mbgl/storage/file_source.hpp b/include/mbgl/storage/file_source.hpp index 7c6e578a9a..3b19e00788 100644 --- a/include/mbgl/storage/file_source.hpp +++ b/include/mbgl/storage/file_source.hpp @@ -5,7 +5,6 @@ #include "resource.hpp" #include -#include #include #include diff --git a/include/mbgl/util/std.hpp b/include/mbgl/util/std.hpp index e64820de47..0e2d3346bf 100644 --- a/include/mbgl/util/std.hpp +++ b/include/mbgl/util/std.hpp @@ -8,29 +8,6 @@ namespace mbgl { namespace util { -// C++14 backfill based on http://llvm.org/svn/llvm-project/libcxx/trunk/include/memory - -namespace detail { -template struct unique_type { typedef ::std::unique_ptr single; }; -template struct unique_type { typedef ::std::unique_ptr unknown_bound; }; -template struct unique_type { typedef void known_bound; }; -} - -template -typename detail::unique_type::single make_unique(Args&&... args) { - return ::std::unique_ptr(new T(::std::forward(args)...)); -} - -template -typename detail::unique_type::unknown_bound make_unique(size_t size) { - return ::std::unique_ptr(new typename ::std::remove_extent::type[size]()); -} - -template -typename detail::unique_type::known_bound make_unique(Args&&...) = delete; - - - template void erase_if(Container &container, ForwardIterator it, const ForwardIterator end, Predicate pred) { while (it != end) { diff --git a/linux/main.cpp b/linux/main.cpp index 558f95dbed..9145b180f4 100644 --- a/linux/main.cpp +++ b/linux/main.cpp @@ -1,6 +1,5 @@ #include #include "../platform/default/default_styles.hpp" -#include #include #include #include @@ -66,7 +65,7 @@ int main(int argc, char *argv[]) { sigIntHandler.sa_flags = 0; sigaction(SIGINT, &sigIntHandler, NULL); - view = mbgl::util::make_unique(); + view = std::make_unique(); mbgl::SQLiteCache cache("/tmp/mbgl-cache.db"); mbgl::DefaultFileSource fileSource(&cache); diff --git a/platform/darwin/http_request_nsurl.mm b/platform/darwin/http_request_nsurl.mm index ad16a69acf..207c33b23c 100644 --- a/platform/darwin/http_request_nsurl.mm +++ b/platform/darwin/http_request_nsurl.mm @@ -2,7 +2,6 @@ #include #include -#include #include #include @@ -250,7 +249,7 @@ void HTTPRequest::handleResult(NSData *data, NSURLResponse *res, NSError *error) } else { // TODO: Use different codes for host not found, timeout, invalid URL etc. // These can be categorized in temporary and permanent errors. - response = util::make_unique(); + response = std::make_unique(); response->status = Response::Error; response->message = [[error localizedDescription] UTF8String]; @@ -282,7 +281,7 @@ void HTTPRequest::handleResult(NSData *data, NSURLResponse *res, NSError *error) } else if ([res isKindOfClass:[NSHTTPURLResponse class]]) { const long responseCode = [(NSHTTPURLResponse *)res statusCode]; - response = util::make_unique(); + response = std::make_unique(); response->data = {(const char *)[data bytes], [data length]}; NSDictionary *headers = [(NSHTTPURLResponse *)res allHeaderFields]; @@ -338,7 +337,7 @@ void HTTPRequest::handleResult(NSData *data, NSURLResponse *res, NSError *error) } else { // This should never happen. status = ResponseStatus::PermanentError; - response = util::make_unique(); + response = std::make_unique(); response->status = Response::Error; response->message = "response class is not NSHTTPURLResponse"; } @@ -364,7 +363,7 @@ void HTTPRequest::retry() { } std::unique_ptr HTTPContext::createContext(uv_loop_t* loop) { - return util::make_unique(loop); + return std::make_unique(loop); } } diff --git a/platform/darwin/image.mm b/platform/darwin/image.mm index a9044774dc..f6a8a6783c 100644 --- a/platform/darwin/image.mm +++ b/platform/darwin/image.mm @@ -1,5 +1,4 @@ #include -#include #import @@ -98,7 +97,7 @@ Image::Image(const std::string &source_data) { height = uint32_t(CGImageGetHeight(image)); CGRect rect = {{ 0, 0 }, { static_cast(width), static_cast(height) }}; - img = util::make_unique(width * height * 4); + img = std::make_unique(width * height * 4); CGContextRef context = CGBitmapContextCreate(img.get(), width, height, 8, width * 4, color_space, kCGImageAlphaPremultipliedLast); if (!context) { diff --git a/platform/default/asset_request_fs.cpp b/platform/default/asset_request_fs.cpp index 9dae2e8a9c..04f85fbc3d 100644 --- a/platform/default/asset_request_fs.cpp +++ b/platform/default/asset_request_fs.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include #include #include @@ -114,7 +113,7 @@ void AssetRequest::fileStated(uv_fs_t *req) { if (stat->st_size > std::numeric_limits::max()) { // File is too large for us to open this way because uv_buf's only support unsigned // ints as maximum size. - auto response = util::make_unique(); + auto response = std::make_unique(); response->status = Response::Error; #if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10 response->message = uv_strerror(uv_err_t {UV_EFBIG, 0}); @@ -126,7 +125,7 @@ void AssetRequest::fileStated(uv_fs_t *req) { uv_fs_req_cleanup(req); uv_fs_close(req->loop, req, self->fd, fileClosed); } else { - self->response = util::make_unique(); + self->response = std::make_unique(); #ifdef __APPLE__ self->response->modified = stat->st_mtimespec.tv_sec; #else @@ -184,7 +183,7 @@ void AssetRequest::notifyError(uv_fs_t *req) { MBGL_VERIFY_THREAD(self->tid); if (req->result < 0 && !self->canceled && req->result != UV_ECANCELED) { - auto response = util::make_unique(); + auto response = std::make_unique(); response->status = Response::Error; response->message = uv::getFileRequestError(req); self->notify(std::move(response), FileCache::Hint::No); @@ -208,7 +207,7 @@ void AssetRequest::cancel() { } std::unique_ptr AssetContext::createContext(uv_loop_t*) { - return util::make_unique(); + return std::make_unique(); } } diff --git a/platform/default/asset_request_zip.cpp b/platform/default/asset_request_zip.cpp index 7666000d00..7fd93c55d1 100644 --- a/platform/default/asset_request_zip.cpp +++ b/platform/default/asset_request_zip.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include @@ -178,7 +177,7 @@ void AssetRequest::fileStated(uv_zip_t *zip) { notifyError("Could not determine file size in zip file"); cleanup(zip); } else { - response = util::make_unique(); + response = std::make_unique(); // Allocate the space for reading the data. response->data.resize(zip->stat->size); @@ -247,7 +246,7 @@ void AssetRequest::notifyError(const char *message) { MBGL_VERIFY_THREAD(tid); if (!cancelled) { - response = util::make_unique(); + response = std::make_unique(); response->status = Response::Error; response->message = message; notify(std::move(response), FileCache::Hint::No); @@ -261,7 +260,7 @@ void AssetRequest::cancel() { } std::unique_ptr AssetContext::createContext(uv_loop_t* loop) { - return util::make_unique(loop); + return std::make_unique(loop); } } diff --git a/platform/default/headless_view.cpp b/platform/default/headless_view.cpp index aa07706d84..0f00c7563d 100644 --- a/platform/default/headless_view.cpp +++ b/platform/default/headless_view.cpp @@ -5,7 +5,6 @@ #include -#include #include #include @@ -172,15 +171,15 @@ std::unique_ptr HeadlessView::readStillImage() { const unsigned int w = dimensions.pixelWidth(); const unsigned int h = dimensions.pixelHeight(); - auto image = util::make_unique(); + auto image = std::make_unique(); image->width = w; image->height = h; - image->pixels = util::make_unique(w * h); + image->pixels = std::make_unique(w * h); MBGL_CHECK_ERROR(glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, image->pixels.get())); const int stride = w * 4; - auto tmp = util::make_unique(stride); + auto tmp = std::make_unique(stride); char *rgba = reinterpret_cast(image->pixels.get()); for (int i = 0, j = h - 1; i < j; i++, j--) { std::memcpy(tmp.get(), rgba + i * stride, stride); diff --git a/platform/default/http_request_curl.cpp b/platform/default/http_request_curl.cpp index 45115b621f..8599ea05ee 100644 --- a/platform/default/http_request_curl.cpp +++ b/platform/default/http_request_curl.cpp @@ -385,7 +385,7 @@ static CURLcode sslctx_function(CURL * /* curl */, void *sslctx, void * /* parm return CURLE_SSL_CACERT_BADFILE; } - const auto pem = util::make_unique(stat.size); + const auto pem = std::make_unique(stat.size); if (static_cast(zip_fread(apkFile, reinterpret_cast(pem.get()), stat.size)) != stat.size) { zip_fclose(apkFile); @@ -537,7 +537,7 @@ size_t HTTPRequest::writeCallback(void *const contents, const size_t size, const MBGL_VERIFY_THREAD(impl->tid); if (!impl->response) { - impl->response = util::make_unique(); + impl->response = std::make_unique(); } impl->response->data.append((char *)contents, size * nmemb); @@ -581,7 +581,7 @@ size_t HTTPRequest::headerCallback(char *const buffer, const size_t size, const MBGL_VERIFY_THREAD(baton->tid); if (!baton->response) { - baton->response = util::make_unique(); + baton->response = std::make_unique(); } const size_t length = size * nmemb; @@ -675,7 +675,7 @@ void HTTPRequest::handleResult(CURLcode code) { // Make sure a response object exists in case we haven't got any headers // or content. if (!response) { - response = util::make_unique(); + response = std::make_unique(); } // Add human-readable error code @@ -734,7 +734,7 @@ void HTTPRequest::handleResult(CURLcode code) { } std::unique_ptr HTTPContext::createContext(uv_loop_t* loop) { - return util::make_unique(loop); + return std::make_unique(loop); } } diff --git a/platform/default/image.cpp b/platform/default/image.cpp index 1a10d78ffa..12aea898c8 100644 --- a/platform/default/image.cpp +++ b/platform/default/image.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include @@ -82,7 +81,7 @@ Image::Image(std::string const& data) auto reader = getImageReader(data.c_str(), data.size()); width = reader->width(); height = reader->height(); - img = util::make_unique(width * height * 4); + img = std::make_unique(width * height * 4); reader->read(0, 0, width, height, img.get()); } catch (ImageReaderException const& ex) diff --git a/platform/default/image_reader.cpp b/platform/default/image_reader.cpp index fc6daec6a5..e80ccb6819 100644 --- a/platform/default/image_reader.cpp +++ b/platform/default/image_reader.cpp @@ -49,11 +49,11 @@ std::unique_ptr getImageReader(char const* data, size_t size) { if (*type == "png") { - return util::make_unique>(data, size); + return std::make_unique>(data, size); } else if (*type == "jpeg") { - return util::make_unique>(data, size); + return std::make_unique>(data, size); } } throw ImageReaderException("ImageReader: can't determine type from input data"); diff --git a/platform/default/sqlite_cache.cpp b/platform/default/sqlite_cache.cpp index fb4cdf74e7..06d168ce4e 100644 --- a/platform/default/sqlite_cache.cpp +++ b/platform/default/sqlite_cache.cpp @@ -62,7 +62,7 @@ std::string unifyMapboxURLs(const std::string &url) { using namespace mapbox::sqlite; SQLiteCache::SQLiteCache(const std::string& path_) - : thread(util::make_unique>("SQLite Cache", util::ThreadPriority::Low, path_)) { + : thread(std::make_unique>("SQLite Cache", util::ThreadPriority::Low, path_)) { } SQLiteCache::~SQLiteCache() = default; @@ -85,7 +85,7 @@ SQLiteCache::Impl::~Impl() { } void SQLiteCache::Impl::createDatabase() { - db = util::make_unique(path.c_str(), ReadWrite | Create); + db = std::make_unique(path.c_str(), ReadWrite | Create); } void SQLiteCache::Impl::createSchema() { @@ -114,7 +114,7 @@ void SQLiteCache::Impl::createSchema() { } catch (util::IOException& ioEx) { Log::Error(Event::Database, ex.code, ex.what()); } - db = util::make_unique(path.c_str(), ReadWrite | Create); + db = std::make_unique(path.c_str(), ReadWrite | Create); } else { Log::Error(Event::Database, ex.code, ex.what()); } @@ -146,8 +146,8 @@ std::unique_ptr SQLiteCache::Impl::get(const Resource &resource) { } if (!getStmt) { - // Initialize the statement 0 1 - getStmt = util::make_unique(db->prepare("SELECT `status`, `modified`, " + // Initialize the statement 0 1 + getStmt = std::make_unique(db->prepare("SELECT `status`, `modified`, " // 2 3 4 5 1 "`etag`, `expires`, `data`, `compressed` FROM `http_cache` WHERE `url` = ?")); } else { @@ -158,7 +158,7 @@ std::unique_ptr SQLiteCache::Impl::get(const Resource &resource) { getStmt->bind(1, unifiedURL.c_str()); if (getStmt->run()) { // There is data. - auto response = util::make_unique(); + auto response = std::make_unique(); response->status = Response::Status(getStmt->get(0)); response->modified = getStmt->get(1); response->etag = getStmt->get(2); @@ -200,7 +200,7 @@ void SQLiteCache::Impl::put(const Resource& resource, std::shared_ptr(db->prepare("REPLACE INTO `http_cache` (" + putStmt = std::make_unique(db->prepare("REPLACE INTO `http_cache` (" // 1 2 3 4 5 6 7 8 "`url`, `status`, `kind`, `modified`, `etag`, `expires`, `data`, `compressed`" ") VALUES(?, ?, ?, ?, ?, ?, ?, ?)")); @@ -249,7 +249,7 @@ void SQLiteCache::Impl::refresh(const Resource& resource, int64_t expires) { } if (!refreshStmt) { - refreshStmt = util::make_unique( // 1 2 + refreshStmt = std::make_unique( // 1 2 db->prepare("UPDATE `http_cache` SET `expires` = ? WHERE `url` = ?")); } else { refreshStmt->reset(); diff --git a/src/mbgl/geometry/glyph_atlas.cpp b/src/mbgl/geometry/glyph_atlas.cpp index 0c6af54785..067c5a4062 100644 --- a/src/mbgl/geometry/glyph_atlas.cpp +++ b/src/mbgl/geometry/glyph_atlas.cpp @@ -6,8 +6,6 @@ #include #include -#include - #include #include @@ -18,7 +16,7 @@ GlyphAtlas::GlyphAtlas(uint16_t width_, uint16_t height_) : width(width_), height(height_), bin(width_, height_), - data(util::make_unique(width_ * height_)), + data(std::make_unique(width_ * height_)), dirty(true) { } diff --git a/src/mbgl/geometry/line_atlas.cpp b/src/mbgl/geometry/line_atlas.cpp index 91ac15639b..dc5ee0901a 100644 --- a/src/mbgl/geometry/line_atlas.cpp +++ b/src/mbgl/geometry/line_atlas.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include @@ -15,7 +14,7 @@ using namespace mbgl; LineAtlas::LineAtlas(uint16_t w, uint16_t h) : width(w), height(h), - data(util::make_unique(w * h)), + data(std::make_unique(w * h)), dirty(true) { } diff --git a/src/mbgl/geometry/sprite_atlas.cpp b/src/mbgl/geometry/sprite_atlas.cpp index 30624e2d1c..93bc76aa5c 100644 --- a/src/mbgl/geometry/sprite_atlas.cpp +++ b/src/mbgl/geometry/sprite_atlas.cpp @@ -140,7 +140,7 @@ void SpriteAtlas::allocate() { if (!data) { dimension w = static_cast(width * pixelRatio); dimension h = static_cast(height * pixelRatio); - data = util::make_unique(w * h); + data = std::make_unique(w * h); std::fill(data.get(), data.get() + w * h, 0); } } diff --git a/src/mbgl/map/annotation.cpp b/src/mbgl/map/annotation.cpp index 7a7a0ed683..d30052c94a 100644 --- a/src/mbgl/map/annotation.cpp +++ b/src/mbgl/map/annotation.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #include @@ -110,7 +109,7 @@ AnnotationManager::addPointAnnotations(const std::vector& points, // track the annotation global ID and its geometry auto anno_it = annotations.emplace( annotationID, - util::make_unique(AnnotationType::Point, + std::make_unique(AnnotationType::Point, AnnotationSegments({ { points[i] } }))); const uint8_t maxZoom = data.transform.getMaxZoom(); @@ -162,7 +161,7 @@ AnnotationManager::addPointAnnotations(const std::vector& points, // create tile & record annotation association auto tile_pos = tiles.emplace( tileID, std::make_pair(std::unordered_set({ annotationID }), - util::make_unique())); + std::make_unique())); // add point layer to tile tile_pos.first->second.second->addLayer(layerID, layer); } diff --git a/src/mbgl/map/annotation.hpp b/src/mbgl/map/annotation.hpp index a80b03226f..0c9a078e57 100644 --- a/src/mbgl/map/annotation.hpp +++ b/src/mbgl/map/annotation.hpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index 1141cf83bd..026297fb46 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -3,15 +3,14 @@ #include #include -#include #include #include namespace mbgl { Map::Map(View& view, FileSource& fileSource, MapMode mode) - : data(util::make_unique(view, mode)), - context(util::make_unique>("Map", util::ThreadPriority::Regular, view, fileSource, *data)) + : data(std::make_unique(view, mode)), + context(std::make_unique>("Map", util::ThreadPriority::Regular, view, fileSource, *data)) { view.initialize(this); } diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp index 2a03adb158..c8948097f7 100644 --- a/src/mbgl/map/map_context.cpp +++ b/src/mbgl/map/map_context.cpp @@ -20,7 +20,6 @@ #include -#include #include #include #include @@ -34,12 +33,12 @@ MapContext::MapContext(uv_loop_t* loop, View& view_, FileSource& fileSource, Map env(fileSource), envScope(env, ThreadType::Map, "Map"), updated(static_cast(Update::Nothing)), - asyncUpdate(util::make_unique(loop, [this] { update(); })), - glyphStore(util::make_unique(loop, env)), - glyphAtlas(util::make_unique(1024, 1024)), - spriteAtlas(util::make_unique(512, 512)), - lineAtlas(util::make_unique(512, 512)), - texturePool(util::make_unique()) { + asyncUpdate(std::make_unique(loop, [this] { update(); })), + glyphStore(std::make_unique(loop, env)), + glyphAtlas(std::make_unique(1024, 1024)), + spriteAtlas(std::make_unique(512, 512)), + lineAtlas(std::make_unique(512, 512)), + texturePool(std::make_unique()) { assert(Environment::currentlyOn(ThreadType::Map)); asyncUpdate->unref(); @@ -120,7 +119,7 @@ void MapContext::loadStyleJSON(const std::string& json, const std::string& base) resourceLoader.reset(); style.reset(); - style = util::make_unique