diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2017-09-16 00:44:33 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2017-09-21 12:21:18 +0200 |
commit | 82bdd525a38c4beeb8ab35f3c4ca2a24a6107a38 (patch) | |
tree | d82a39638de17b0235b97779f4f9f1d2e367023d /src/mbgl/tile/geometry_tile.cpp | |
parent | 6dfb4ecc439b2a50b65f396142885c47161af28b (diff) | |
download | qtlocation-mapboxgl-82bdd525a38c4beeb8ab35f3c4ca2a24a6107a38.tar.gz |
[core] make sure tiles are not treated as complete until all worker operations completed
Previously, when we started a worker operation that eventually throws an exception (e.g. due to the tile not being parseable), and then enqueue another worker operation while the first one is processing, we treated the worker as idle once the first operation's error callback fired, even though the second operation was still in progress. Due to our use of coalescing, I was unable to come up with a reliable test since we'd need to reproduce the behavior described above, which is timing dependent.
Diffstat (limited to 'src/mbgl/tile/geometry_tile.cpp')
-rw-r--r-- | src/mbgl/tile/geometry_tile.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mbgl/tile/geometry_tile.cpp b/src/mbgl/tile/geometry_tile.cpp index c4d5d3bae3..23b3737a38 100644 --- a/src/mbgl/tile/geometry_tile.cpp +++ b/src/mbgl/tile/geometry_tile.cpp @@ -116,9 +116,10 @@ void GeometryTile::redoLayout() { worker.invoke(&GeometryTileWorker::setLayers, std::move(copy), correlationID); } -void GeometryTile::onLayout(LayoutResult result) { +void GeometryTile::onLayout(LayoutResult result, const uint64_t resultCorrelationID) { loaded = true; renderable = true; + (void)resultCorrelationID; nonSymbolBuckets = std::move(result.nonSymbolBuckets); featureIndex = std::move(result.featureIndex); data = std::move(result.tileData); @@ -126,10 +127,10 @@ void GeometryTile::onLayout(LayoutResult result) { observer->onTileChanged(*this); } -void GeometryTile::onPlacement(PlacementResult result) { +void GeometryTile::onPlacement(PlacementResult result, const uint64_t resultCorrelationID) { loaded = true; renderable = true; - if (result.correlationID == correlationID) { + if (resultCorrelationID == correlationID) { pending = false; } symbolBuckets = std::move(result.symbolBuckets); @@ -140,9 +141,11 @@ void GeometryTile::onPlacement(PlacementResult result) { observer->onTileChanged(*this); } -void GeometryTile::onError(std::exception_ptr err) { +void GeometryTile::onError(std::exception_ptr err, const uint64_t resultCorrelationID) { loaded = true; - pending = false; + if (resultCorrelationID == correlationID) { + pending = false; + } observer->onTileError(*this, err); } |