bevy/crates/bevy_asset
robtfm a66bdd074f
send Unused event when asset is actually unused (#12459)
fix #12344

use existing machinery in track_assets to determine if the asset is
unused before firing Asset::Unused event

~~most extract functions use `AssetEvent::Removed` to schedule deletion
of render world resources. `RenderAssetPlugin` was using
`AssetEvent::Unused` instead.
`Unused` fires when the last strong handle is dropped, even if a new one
is created. `Removed` only fires when a new one is not created.
as far as i can see, `Unused` is the same as `Removed` except for this
"feature", and that it also fires early if all handles for a loading
asset are dropped (`Removed` fires after the loading completes). note
that in that case, processing based on `Loaded` won't have been done
anyway.
i think we should get rid of `Unused` completely, it is not currently
used anywhere (except here, previously) and i think using it is probably
always a mistake.
i also am not sure why we keep loading assets that have been dropped
while loading, we should probably drop the loader task as well and
remove immediately.~~
2024-03-18 22:51:16 +01:00
..
macros Release 0.13.0 (#11920) 2024-02-17 09:24:25 +00:00
src send Unused event when asset is actually unused (#12459) 2024-03-18 22:51:16 +01:00
Cargo.toml Release 0.13.0 (#11920) 2024-02-17 09:24:25 +00:00