From 086a0fc969f90aacebe30214405ad19eb9f3c1bb Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 5 Mar 2019 12:48:59 +0100 Subject: [PATCH] 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. --- LibGUI/GApplication.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/LibGUI/GApplication.cpp b/LibGUI/GApplication.cpp index 9fc3eabfde0..b50549d2db2 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)