Skip to content
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

Put everything in Context behind the same Mutex #1050

Merged
merged 13 commits into from
Jan 10, 2022
Prev Previous commit
Next Next commit
Fix a deadlock
  • Loading branch information
emilk committed Jan 8, 2022
commit 5b0a4398dcb3320c65dbc436763b83c32221e2d6
2 changes: 1 addition & 1 deletion egui-winit/src/epi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ impl EpiIntegration {
}

fn warm_up(&mut self, window: &winit::window::Window) {
let saved_memory = self.egui_ctx.memory().clone();
let saved_memory: egui::Memory = self.egui_ctx.memory().clone();
self.egui_ctx.memory().set_everything_is_visible(true);
let (_, tex_alloc_data, _) = self.update(window);
self.frame.lock().output.tex_allocation_data = tex_alloc_data; // handle it next frame
Expand Down
3 changes: 2 additions & 1 deletion egui/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,8 @@ impl CtxRef {
.show(ui, |ui| {
let mut font_definitions = self.fonts().definitions().clone();
font_definitions.ui(ui);
self.fonts().font_image().ui(ui);
let font_image = self.fonts().font_image();
font_image.ui(ui);
self.set_fonts(font_definitions);
});

Expand Down
2 changes: 1 addition & 1 deletion egui_web/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ impl AppRunner {

pub fn warm_up(&mut self) -> Result<(), JsValue> {
if self.app.warm_up_enabled() {
let saved_memory = self.egui_ctx.memory().clone();
let saved_memory: egui::Memory = self.egui_ctx.memory().clone();
self.egui_ctx.memory().set_everything_is_visible(true);
self.logic()?;
*self.egui_ctx.memory() = saved_memory; // We don't want to remember that windows were huge.
Expand Down