Use cx.quit() instead of std::process::exit(0) (#47)

This commit is contained in:
Floyd Wang 2024-07-18 19:02:39 +08:00 committed by GitHub
parent 653222db73
commit e4b9e008ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -55,6 +55,6 @@ fn main() {
}); });
} }
fn quit(_: &Quit, _cx: &mut AppContext) { fn quit(_: &Quit, cx: &mut AppContext) {
std::process::exit(0); cx.quit();
} }

View file

@ -208,9 +208,9 @@ impl StoryWorkspace {
.update(&mut cx, |_, cx| { .update(&mut cx, |_, cx| {
cx.activate_window(); cx.activate_window();
cx.set_window_title("GPUI App"); cx.set_window_title("GPUI App");
cx.on_release(|_, _, _cx| { cx.on_release(|_, _, cx| {
// exit app // exit app
std::process::exit(0); cx.quit();
}) })
.detach(); .detach();
}) })