[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user