diff options
author | Andreas Kling <kling@serenityos.org> | 2020-07-04 14:05:19 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-04 14:05:57 +0200 |
commit | 1dd15950439f4027f6412bb3748f7f433e60924b (patch) | |
tree | 9d80cf082ebb91247bc885a444d58514a4d9a8df /DevTools/HackStudio | |
parent | 0d577ab7815f6ccdba7d85d94ae8cc80d96ea5ea (diff) | |
download | serenity-1dd15950439f4027f6412bb3748f7f433e60924b.zip |
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.
Diffstat (limited to 'DevTools/HackStudio')
-rw-r--r-- | DevTools/HackStudio/main.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/DevTools/HackStudio/main.cpp b/DevTools/HackStudio/main.cpp index e6357639f7..b4b99938c6 100644 --- a/DevTools/HackStudio/main.cpp +++ b/DevTools/HackStudio/main.cpp @@ -160,7 +160,7 @@ int main(int argc, char** argv) return 1; } - GUI::Application app(argc, argv); + auto app = GUI::Application::construct(argc, argv); if (pledge("stdio tty accept rpath cpath wpath shared_buffer proc exec fattr thread", nullptr) < 0) { perror("pledge"); @@ -525,7 +525,7 @@ int main(int argc, char** argv) app_menu.add_action(save_action); app_menu.add_separator(); app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { - app.quit(); + app->quit(); })); auto& project_menu = menubar->add_menu("Project"); @@ -664,7 +664,7 @@ int main(int argc, char** argv) GUI::AboutDialog::show("HackStudio", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-hack-studio.png"), g_window); })); - app.set_menubar(move(menubar)); + app->set_menubar(move(menubar)); g_window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-hack-studio.png")); @@ -691,7 +691,7 @@ int main(int argc, char** argv) open_file(g_project->default_file()); update_actions(); - return app.exec(); + return app->exec(); } void build(TerminalWrapper& wrapper) |