[core] Replace shared_ptr with unique_ptr in {Map,Resource}Options

This commit is contained in:
Bruno de Oliveira Abinader
2019-03-21 18:36:43 +02:00
parent 2de2b0b068
commit 03db58cdc1
8 changed files with 87 additions and 75 deletions

View File

@@ -631,14 +631,9 @@ void NodeMap::cancel() {
});
frontend = std::make_unique<mbgl::HeadlessFrontend>(mbgl::Size{ 256, 256 }, pixelRatio, threadpool);
auto mapOptions = mbgl::MapOptions()
.withMapMode(mode)
.withCrossSourceCollisions(crossSourceCollisions);
auto resourceOptions = mbgl::ResourceOptions().withPlatformContext(reinterpret_cast<void*>(this));
map = std::make_unique<mbgl::Map>(*frontend, mapObserver, frontend->getSize(), pixelRatio,
threadpool, mapOptions, resourceOptions);
map = std::make_unique<mbgl::Map>(*frontend, mapObserver, frontend->getSize(), pixelRatio, threadpool,
mbgl::MapOptions().withMapMode(mode).withCrossSourceCollisions(crossSourceCollisions),
mbgl::ResourceOptions().withPlatformContext(reinterpret_cast<void*>(this)));
// FIXME: Reload the style after recreating the map. We need to find
// a better way of canceling an ongoing rendering on the core level