Skip to content

Commit

Permalink
Update context.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
rustbasic authored Dec 6, 2024
1 parent 5f6fe50 commit aca3041
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions crates/egui/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3355,16 +3355,30 @@ impl Context {

crate::profile_function!();

if uri.is_empty() {
return;
}

let mut frame_count: usize = 0;
let loaders = self.loaders();

loaders.include.forget(uri);
for loader in loaders.bytes.lock().iter() {
loader.forget(uri);
}
for loader in loaders.image.lock().iter() {
if crate::is_gif_uri(uri) {
frame_count = loader.frame_count(uri).max(frame_count);
}
loader.forget(uri);
}
for loader in loaders.texture.lock().iter() {
if crate::is_gif_uri(uri) {
for frame_index in 0..frame_count {
let frame_uri = crate::encode_gif_uri(uri, frame_index);
loader.forget(&frame_uri);
}
}
loader.forget(uri);
}
}
Expand Down

0 comments on commit aca3041

Please sign in to comment.