| 678 | } |
| 679 | |
| 680 | void TextureCache::removeTexture(Texture2D* texture) |
| 681 | { |
| 682 | if (!texture) |
| 683 | { |
| 684 | return; |
| 685 | } |
| 686 | |
| 687 | for (auto it = _textures.cbegin(); it != _textures.cend(); /* nothing */) |
| 688 | { |
| 689 | if (it->second == texture) |
| 690 | { |
| 691 | it->second->release(); |
| 692 | it = _textures.erase(it); |
| 693 | break; |
| 694 | } |
| 695 | else |
| 696 | ++it; |
| 697 | } |
| 698 | } |
| 699 | |
| 700 | void TextureCache::removeTextureForKey(std::string_view textureKeyName) |
| 701 | { |