summaryrefslogtreecommitdiff
path: root/Demos/HelloWorld
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-07-04 14:05:19 +0200
committerAndreas Kling <kling@serenityos.org>2020-07-04 14:05:57 +0200
commit1dd15950439f4027f6412bb3748f7f433e60924b (patch)
tree9d80cf082ebb91247bc885a444d58514a4d9a8df /Demos/HelloWorld
parent0d577ab7815f6ccdba7d85d94ae8cc80d96ea5ea (diff)
downloadserenity-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 'Demos/HelloWorld')
-rw-r--r--Demos/HelloWorld/main.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Demos/HelloWorld/main.cpp b/Demos/HelloWorld/main.cpp
index 79e6934926..aea01a2d41 100644
--- a/Demos/HelloWorld/main.cpp
+++ b/Demos/HelloWorld/main.cpp
@@ -33,7 +33,7 @@
int main(int argc, char** argv)
{
- GUI::Application app(argc, argv);
+ auto app = GUI::Application::construct(argc, argv);
auto window = GUI::Window::construct();
window->set_rect(100, 100, 240, 160);
@@ -53,10 +53,10 @@ int main(int argc, char** argv)
button.set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
button.set_preferred_size(0, 20);
button.on_click = [&](auto) {
- app.quit();
+ app->quit();
};
window->show();
- return app.exec();
+ return app->exec();
}