diff options
author | Lucas CHOLLET <lucas.chollet@free.fr> | 2023-05-05 00:24:53 -0400 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2023-05-05 16:41:21 +0100 |
commit | 1a97382305f517dcc4c4f71746b6ab5d96012b0d (patch) | |
tree | 71bc8573bea401d8a27847c1dadeeceb518fd1a0 /Userland/Games/FlappyBug | |
parent | f132751faeaa486c3eebc1ed23117efe9701da22 (diff) | |
download | serenity-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/Games/FlappyBug')
-rw-r--r-- | Userland/Games/FlappyBug/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Games/FlappyBug/main.cpp b/Userland/Games/FlappyBug/main.cpp index 245b7afc82..e390aec4e9 100644 --- a/Userland/Games/FlappyBug/main.cpp +++ b/Userland/Games/FlappyBug/main.cpp @@ -21,7 +21,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) { TRY(Core::System::pledge("stdio rpath recvfd sendfd unix")); - auto app = TRY(GUI::Application::try_create(arguments)); + auto app = TRY(GUI::Application::create(arguments)); Config::pledge_domain("FlappyBug"); |