Browse Source

eframe native: Make sure we only shut down once

I don't trust winit to actually exit on ControlFlow::Exit

Perhaps this will solve https://github.com/emilk/egui/issues/2027
pull/2036/head
Emil Ernerfeldt 2 years ago
parent
commit
e0c7533ede
  1. 4
      crates/eframe/src/native/run.rs

4
crates/eframe/src/native/run.rs

@ -407,7 +407,7 @@ mod glow_integration {
} }
fn save_and_destroy(&mut self) { fn save_and_destroy(&mut self) {
if let Some(running) = &mut self.running { if let Some(mut running) = self.running.take() {
running running
.integration .integration
.save(running.app.as_mut(), running.gl_window.window()); .save(running.app.as_mut(), running.gl_window.window());
@ -778,7 +778,7 @@ mod wgpu_integration {
} }
fn save_and_destroy(&mut self) { fn save_and_destroy(&mut self) {
if let Some(running) = &mut self.running { if let Some(mut running) = self.running.take() {
if let Some(window) = &self.window { if let Some(window) = &self.window {
running.integration.save(running.app.as_mut(), window); running.integration.save(running.app.as_mut(), window);
} }

Loading…
Cancel
Save