Skip to content

fix: Assertion in egui_extras::FileLoader::load #6995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bircni
Copy link
Contributor

@bircni bircni commented May 3, 2025

This pull request modifies the BytesLoader implementation for FileLoader in crates/egui_extras/src/loaders/file_loader.rs to improve thread safety and handle unexpected states more gracefully.

Changes to thread safety and state handling:

…::forget_image is called while image is loading
Copy link

github-actions bot commented May 3, 2025

Preview available at https://egui-pr-preview.github.io/pr/6995-patch6755
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

ctx.request_repaint();
log::trace!("finished loading {uri:?}");
} else {
log::trace!("cancelled loading {uri:?}");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should explain why we ignore the newly loaded image and cancel. I.e., that it can only happen because forget_image was called.

We should also document that forget_image cancels in-progress loads, if any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants