move save_settings into callback (#925)

This commit is contained in:
Logan McNaughton
2026-05-20 10:34:33 +02:00
committed by GitHub
parent c53ffebece
commit 2eb8a0dc1d
+8 -1
View File
@@ -521,8 +521,15 @@ pub fn app_window(is_android: bool) {
}
ui::netplay::netplay_window(&app);
ui::cheats::cheats_window(&app);
let weak_app = app.as_weak();
app.window().on_close_requested(move || {
weak_app
.upgrade_in_event_loop(move |handle| save_settings(&handle))
.unwrap();
slint::CloseRequestResponse::HideWindow
});
app.run().unwrap();
save_settings(&app);
}
pub fn run_rom(