summaryrefslogtreecommitdiff
path: root/Userland/Applications/3DFileViewer
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/Applications/3DFileViewer
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/Applications/3DFileViewer')
-rw-r--r--Userland/Applications/3DFileViewer/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Applications/3DFileViewer/main.cpp b/Userland/Applications/3DFileViewer/main.cpp
index 6f618a8c1f..f1b32c7ea6 100644
--- a/Userland/Applications/3DFileViewer/main.cpp
+++ b/Userland/Applications/3DFileViewer/main.cpp
@@ -348,7 +348,7 @@ bool GLContextWidget::load_file(String const& filename, NonnullOwnPtr<Core::File
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
TRY(Core::System::pledge("stdio thread recvfd sendfd rpath unix prot_exec map_fixed"));