1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:47:35 +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

@ -42,7 +42,7 @@ int main(int argc, char** argv)
return 1;
}
GUI::Application app(argc, argv);
auto app = GUI::Application::construct(argc, argv);
if (pledge("stdio rpath wpath cpath shared_buffer accept", nullptr) < 0) {
perror("pledge");
@ -73,11 +73,11 @@ int main(int argc, char** argv)
GUI::AboutDialog::show("Snake", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-snake.png"), window);
}));
app.set_menubar(move(menubar));
app->set_menubar(move(menubar));
window->show();
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-snake.png"));
return app.exec();
return app->exec();
}