Function free_egui_textures_system

Source
pub fn free_egui_textures_system(
    egui_user_textures: ResMut<'_, EguiUserTextures>,
    egui_render_output: Query<'_, '_, (Entity, &EguiRenderOutput), Or<(With<Window>, With<EguiRenderToImage>)>>,
    egui_managed_textures: ResMut<'_, EguiManagedTextures>,
    image_assets: ResMut<'_, Assets<Image>>,
    image_events: EventReader<'_, '_, AssetEvent<Image>>,
)
Expand description

This system is responsible for deleting image assets of freed Egui-managed textures and deleting Egui user textures of removed Bevy image assets.

If you add textures via EguiContexts::add_image or EguiUserTextures::add_image by passing a weak handle, the systems ensures that corresponding Egui textures are cleaned up as well.