diff options
author | Andreas Kling <kling@serenityos.org> | 2020-07-04 16:52:01 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-04 16:54:55 +0200 |
commit | ca93c22ae2706c35828f913976f35e828157bb01 (patch) | |
tree | 6daa1e52973d55636634ceb69fc0fe15b6bd50f4 /Libraries/LibVT | |
parent | f7577585a6794228659e5e7b496cddfd8a94b54d (diff) | |
download | serenity-ca93c22ae2706c35828f913976f35e828157bb01.zip |
LibGUI: Turn GUI::Application::the() into a pointer
During app teardown, the Application object may be destroyed before
something else, and so having Application::the() return a reference was
obscuring the truth about its lifetime.
This patch makes the API more honest by returning a pointer. While
this makes call sites look a bit more sketchy, do note that the global
Application pointer only becomes null during app teardown.
Diffstat (limited to 'Libraries/LibVT')
-rw-r--r-- | Libraries/LibVT/TerminalWidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibVT/TerminalWidget.cpp b/Libraries/LibVT/TerminalWidget.cpp index c191c12461..d99870e239 100644 --- a/Libraries/LibVT/TerminalWidget.cpp +++ b/Libraries/LibVT/TerminalWidget.cpp @@ -70,7 +70,7 @@ void TerminalWidget::set_pty_master_fd(int fd) if (nread < 0) { dbgprintf("Terminal read error: %s\n", strerror(errno)); perror("read(ptm)"); - GUI::Application::the().quit(1); + GUI::Application::the()->quit(1); return; } if (nread == 0) { |