diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-10-19 09:01:41 -0700 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-10-19 09:01:41 -0700 |
commit | ac7b40dc9a14e48ef041b9f2e47f0b563abe64cc (patch) | |
tree | 2a57dd02bfe54d7a33a2a8480cc80aaf7fe648ec | |
parent | 945e53af4ef5c6473080ef7efe2d885aefeac3ab (diff) | |
download | qtlocation-mapboxgl-ac7b40dc9a14e48ef041b9f2e47f0b563abe64cc.tar.gz |
[node] Reuse HeadlessFrontend if any in NodeMap::cancel()
-rw-r--r-- | platform/node/src/node_map.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/platform/node/src/node_map.cpp b/platform/node/src/node_map.cpp index f344461f31..198e9301f8 100644 --- a/platform/node/src/node_map.cpp +++ b/platform/node/src/node_map.cpp @@ -538,7 +538,10 @@ void NodeMap::cancel() { // Reset map explicitly as it resets the renderer frontend map.reset(); - frontend = std::make_unique<mbgl::HeadlessFrontend>(mbgl::Size{ 256, 256 }, pixelRatio, *this, threadpool); + if (!frontend) { + frontend = std::make_unique<mbgl::HeadlessFrontend>(mbgl::Size{ 256, 256 }, pixelRatio, *this, threadpool); + } + map = std::make_unique<mbgl::Map>(*frontend, mapObserver, frontend->getSize(), pixelRatio, *this, threadpool, mbgl::MapMode::Still); |