Skip to content

Commit

Permalink
Save savegame on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
p4ddy1 committed Feb 12, 2022
1 parent d17809b commit 0a70a64
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gbemulator/src/graphics/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ impl<'a> GraphicsWindow<'a> {
match event {
Event::WindowEvent { event, .. } => match event {
WindowEvent::CloseRequested => {
if let Some(signal_sender) = &self.emulation_signal_sender {
signal_sender.send(EmulationSignal::Quit).unwrap();
}
*control_flow = ControlFlow::Exit;
println!("Closing...");
return;
Expand Down

0 comments on commit 0a70a64

Please sign in to comment.