[core] Pass ImageManager to ImageRequestor's constructor

This makes ImageRequestor API explicitly dependant on ImageManager, so that
ImageRequestor can unregister itself from ImageManager on destruction.
This commit is contained in:
Alexander Shalamov
2019-04-23 16:08:16 +03:00
parent 9a70e755dc
commit 83c33cdeb2
5 changed files with 25 additions and 11 deletions

View File

@@ -288,4 +288,11 @@ gfx::TextureBinding ImageManager::textureBinding(gfx::Context& context) {
return { atlasTexture->getResource(), gfx::TextureFilterType::Linear };
}
ImageRequestor::ImageRequestor(ImageManager& imageManager_) : imageManager(imageManager_) {
}
ImageRequestor::~ImageRequestor() {
imageManager.removeRequestor(*this);
}
} // namespace mbgl