diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-03-05 12:48:59 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-03-05 12:48:59 +0100 |
commit | 086a0fc969f90aacebe30214405ad19eb9f3c1bb (patch) | |
tree | e11857fe33557964ef99c1950f626d9923f15d87 /LibGUI | |
parent | 9e1fcb74a2473d1053435a612586efb76ec72f34 (diff) | |
download | serenity-086a0fc969f90aacebe30214405ad19eb9f3c1bb.zip |
LibGUI: Let GApplication::exec() call exit() instead of returning to main().
This sidesteps the problem of having various things on the heap that don't
get torn down. It's obviously not a great solution, but it'll work for now.
Diffstat (limited to 'LibGUI')
-rw-r--r-- | LibGUI/GApplication.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/LibGUI/GApplication.cpp b/LibGUI/GApplication.cpp index 9fc3eabfde..b50549d2db 100644 --- a/LibGUI/GApplication.cpp +++ b/LibGUI/GApplication.cpp @@ -22,11 +22,16 @@ GApplication::GApplication(int argc, char** argv) GApplication::~GApplication() { + s_the = nullptr; } int GApplication::exec() { - return m_event_loop->exec(); + int exit_code = m_event_loop->exec(); + // NOTE: Maybe it would be cool to return instead of exit()? + // This would require cleaning up all the GObjects on the heap. + exit(exit_code); + return exit_code; } void GApplication::quit(int exit_code) |