1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:47:45 +00:00

LibGUI: Make GUI::Application a Core::Object

Having this on the stack makes whole-program teardown iffy. Turning it
into a Core::Object allows anyone who needs it to extends its lifetime.
This commit is contained in:
Andreas Kling 2020-07-04 14:05:19 +02:00
parent 0d577ab781
commit 1dd1595043
51 changed files with 140 additions and 138 deletions

View file

@ -39,7 +39,7 @@ int main(int argc, char** argv)
return 1;
}
GUI::Application app(argc, argv);
auto app = GUI::Application::construct(argc, argv);
auto server = Core::LocalServer::construct();
bool ok = server->take_over_from_system_server();
@ -67,5 +67,5 @@ int main(int argc, char** argv)
return 1;
}
return app.exec();
return app->exec();
}

View file

@ -65,8 +65,8 @@ static NonnullRefPtr<GUI::Menu> build_system_menu();
int main(int argc, char** argv)
{
GUI::Application app(argc, argv);
app.set_quit_when_last_window_deleted(false);
auto app = GUI::Application::construct(argc, argv);
app->set_quit_when_last_window_deleted(false);
auto menu = build_system_menu();
menu->realize_menu_if_needed();
@ -95,7 +95,7 @@ int main(int argc, char** argv)
unveil(nullptr, nullptr);
return app.exec();
return app->exec();
}
NonnullRefPtr<GUI::Menu> build_system_menu()

View file

@ -37,7 +37,7 @@ int main(int argc, char** argv)
return 1;
}
GUI::Application app(argc, argv);
auto app = GUI::Application::construct(argc, argv);
signal(SIGCHLD, [](int signo) {
(void)signo;
@ -52,5 +52,5 @@ int main(int argc, char** argv)
TaskbarWindow window;
window.show();
return app.exec();
return app->exec();
}