Index: cc/resources/tile_manager.cc |
diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc |
index 5d183ae55290c5ef6909462f62c34fe3225d2b55..1e3c132ab646e4078f458dcc236dfe711f34723b 100644 |
--- a/cc/resources/tile_manager.cc |
+++ b/cc/resources/tile_manager.cc |
@@ -277,12 +277,10 @@ void TileManager::FreeResourcesForReleasedTiles() { |
} |
void TileManager::CleanUpReleasedTiles() { |
- std::vector<Tile*>::iterator it = released_tiles_.begin(); |
- while (it != released_tiles_.end()) { |
- Tile* tile = *it; |
- |
+ std::vector<Tile*> tiles_to_retain; |
enne (OOO)
2015/04/07 23:04:48
Should you reserve this to be the number of tiles
vmpstr
2015/04/07 23:10:23
I'm not sure it's worth it, since the number of ti
|
+ for (auto* tile : released_tiles_) { |
if (tile->HasRasterTask()) { |
- ++it; |
+ tiles_to_retain.push_back(tile); |
continue; |
} |
@@ -299,8 +297,8 @@ void TileManager::CleanUpReleasedTiles() { |
} |
delete tile; |
- it = released_tiles_.erase(it); |
} |
+ released_tiles_.swap(tiles_to_retain); |
} |
void TileManager::DidFinishRunningTileTasks(TaskSet task_set) { |