summaryrefslogtreecommitdiff
path: root/Userland/Demos/Tubes
diff options
context:
space:
mode:
authorLucas CHOLLET <lucas.chollet@free.fr>2023-05-05 00:24:53 -0400
committerSam Atkins <atkinssj@gmail.com>2023-05-05 16:41:21 +0100
commit1a97382305f517dcc4c4f71746b6ab5d96012b0d (patch)
tree71bc8573bea401d8a27847c1dadeeceb518fd1a0 /Userland/Demos/Tubes
parentf132751faeaa486c3eebc1ed23117efe9701da22 (diff)
downloadserenity-1a97382305f517dcc4c4f71746b6ab5d96012b0d.zip
LibGUI: Make `Application`'s construction fallible
The pattern to construct `Application` was to use the `try_create` method from the `C_OBJECT` macro. While being safe from an OOM perspective, this method doesn't propagate errors from the constructor. This patch make `Application` use the `C_OBJECT_ABSTRACT` and manually define a `create` method that can bubble up errors from the construction stage. This commit also removes the ability to use `argc` and `argv` to create an `Application`, only `Main`'s `Arguments` can be used. From a user point of view, the patch renames `try_create` => `create`, hence the huge number of modified files.
Diffstat (limited to 'Userland/Demos/Tubes')
-rw-r--r--Userland/Demos/Tubes/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Demos/Tubes/main.cpp b/Userland/Demos/Tubes/main.cpp
index 33ae9ecca2..9f585e205a 100644
--- a/Userland/Demos/Tubes/main.cpp
+++ b/Userland/Demos/Tubes/main.cpp
@@ -22,7 +22,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.add_option(refresh_rate, "Refresh rate", "rate", 'r', "milliseconds");
args_parser.parse(arguments);
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio recvfd sendfd rpath prot_exec map_fixed"));