mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 20:53:53 +00:00
724fe49c73
# Objective Fix a memory leak in `TextureCache` caused by the internal HashMap never having unused entries cleared. This isn't a giant memory leak, given the unused entries are simply empty vectors. Though, if someone goes and resizes a window a bunch, it can lead to hundreds/thousands of TextureDescriptor keys adding up in the hashmap – which isn't ideal. ## Solution - Only retain hashmap entries that still have textures. - I also added an `is_empty()` method to `TextureCache`, which is useful for 3rd-party higher-level caches that might have individual caches by view entity or texture type, for example. ## Testing - Verified the examples still work (this is a trivial change) |
||
---|---|---|
.. | ||
macros | ||
src | ||
Cargo.toml | ||
README.md |