diff options
author | Timothy <timmot@users.noreply.github.com> | 2021-08-03 22:05:07 +1000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-03 18:55:52 +0200 |
commit | 73c1b1617a2e538dee6c49dd04ad2601a7544b45 (patch) | |
tree | dce22b051695a26e95eca9cc69488e82ccfc60bb /Userland/Demos | |
parent | 2caafacd9ba9c67bb80f968d94f6a51e04f2b040 (diff) | |
download | serenity-73c1b1617a2e538dee6c49dd04ad2601a7544b45.zip |
Everywhere: Replace most cases of exit() with Application::quit()
Application::quit() is nicer for most cases where exit() is used. Cases
where exit() is used intentionally for early termination are left
intact.
Diffstat (limited to 'Userland/Demos')
-rw-r--r-- | Userland/Demos/Screensaver/Screensaver.cpp | 6 | ||||
-rw-r--r-- | Userland/Demos/Starfield/Starfield.cpp | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Demos/Screensaver/Screensaver.cpp b/Userland/Demos/Screensaver/Screensaver.cpp index 1ee8e3e31f..0c09f03c0c 100644 --- a/Userland/Demos/Screensaver/Screensaver.cpp +++ b/Userland/Demos/Screensaver/Screensaver.cpp @@ -52,18 +52,18 @@ void Screensaver::mousemove_event(GUI::MouseEvent& event) if (m_mouse_origin.is_null()) { m_mouse_origin = event.position(); } else if (event.position().distance_from(m_mouse_origin) > max_distance_move) { - ::exit(0); + GUI::Application::the()->quit(); } } void Screensaver::mousedown_event(GUI::MouseEvent&) { - ::exit(0); + GUI::Application::the()->quit(); } void Screensaver::keydown_event(GUI::KeyEvent&) { - ::exit(0); + GUI::Application::the()->quit(); } void Screensaver::paint_event(GUI::PaintEvent& event) diff --git a/Userland/Demos/Starfield/Starfield.cpp b/Userland/Demos/Starfield/Starfield.cpp index 3dbb98ac02..aabc130225 100644 --- a/Userland/Demos/Starfield/Starfield.cpp +++ b/Userland/Demos/Starfield/Starfield.cpp @@ -79,12 +79,12 @@ void Starfield::mousemove_event(GUI::MouseEvent&) void Starfield::mousedown_event(GUI::MouseEvent&) { - ::exit(0); + GUI::Application::the()->quit(); } void Starfield::keydown_event(GUI::KeyEvent&) { - ::exit(0); + GUI::Application::the()->quit(); } void Starfield::paint_event(GUI::PaintEvent& event) |