diff --git a/src/mbgl/map/vector_tile.cpp b/src/mbgl/map/vector_tile.cpp index c53559d9c..343efe431 100644 --- a/src/mbgl/map/vector_tile.cpp +++ b/src/mbgl/map/vector_tile.cpp @@ -185,7 +185,7 @@ VectorTileMonitor::VectorTileMonitor(const TileID& tileID_, const std::string& u std::unique_ptr VectorTileMonitor::monitorTile(const GeometryTileMonitor::Callback& callback) { const std::string url = util::templateTileURL(urlTemplate, tileID); return util::ThreadContext::getFileSource()->request({ Resource::Kind::Tile, url }, [callback, this](Response res) { - if (res.data && data == res.data) { + if (res.notModified) { // We got the same data again. Abort early. return; } @@ -200,8 +200,7 @@ std::unique_ptr VectorTileMonitor::monitorTile(const GeometryTileMo } } - data = res.data; - callback(nullptr, std::make_unique(data), res.modified, res.expires); + callback(nullptr, std::make_unique(res.data), res.modified, res.expires); }); } diff --git a/src/mbgl/map/vector_tile.hpp b/src/mbgl/map/vector_tile.hpp index fb2007aa4..1b836b84b 100644 --- a/src/mbgl/map/vector_tile.hpp +++ b/src/mbgl/map/vector_tile.hpp @@ -68,7 +68,6 @@ public: private: TileID tileID; std::string urlTemplate; - std::shared_ptr data; }; } // namespace mbgl