Skip to content

Commit e0c7533

Browse files
committed
eframe native: Make sure we only shut down once
I don't trust winit to actually exit on ControlFlow::Exit Perhaps this will solve #2027
1 parent 1fe08bf commit e0c7533

File tree

1 file changed

+2
-2
lines changed
  • crates/eframe/src/native

1 file changed

+2
-2
lines changed

crates/eframe/src/native/run.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ mod glow_integration {
407407
}
408408

409409
fn save_and_destroy(&mut self) {
410-
if let Some(running) = &mut self.running {
410+
if let Some(mut running) = self.running.take() {
411411
running
412412
.integration
413413
.save(running.app.as_mut(), running.gl_window.window());
@@ -778,7 +778,7 @@ mod wgpu_integration {
778778
}
779779

780780
fn save_and_destroy(&mut self) {
781-
if let Some(running) = &mut self.running {
781+
if let Some(mut running) = self.running.take() {
782782
if let Some(window) = &self.window {
783783
running.integration.save(running.app.as_mut(), window);
784784
}

0 commit comments

Comments
 (0)