mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 18:05:08 +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:
parent
0d577ab781
commit
1dd1595043
51 changed files with 140 additions and 138 deletions
|
@ -56,7 +56,7 @@ int main(int argc, char* argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
GUI::Application app(argc, argv);
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
|
||||
if (pledge("stdio shared_buffer accept rpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
|
@ -201,12 +201,12 @@ int main(int argc, char* argv[])
|
|||
go_menu.add_action(*go_back_action);
|
||||
go_menu.add_action(*go_forward_action);
|
||||
|
||||
app.set_menubar(move(menubar));
|
||||
app->set_menubar(move(menubar));
|
||||
|
||||
window->set_focused_widget(&tree_view);
|
||||
window->show();
|
||||
|
||||
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/book.png"));
|
||||
|
||||
return app.exec();
|
||||
return app->exec();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue