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)