summaryrefslogtreecommitdiff
path: root/Userland/Applets/ClipboardHistory/main.cpp
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/Applets/ClipboardHistory/main.cpp
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/Applets/ClipboardHistory/main.cpp')
-rw-r--r--Userland/Applets/ClipboardHistory/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Applets/ClipboardHistory/main.cpp b/Userland/Applets/ClipboardHistory/main.cpp
index bea6d1f8e6..95a16d105b 100644
--- a/Userland/Applets/ClipboardHistory/main.cpp
+++ b/Userland/Applets/ClipboardHistory/main.cpp
@@ -18,7 +18,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix"));
- auto app = TRY(GUI::Application::try_create(arguments));
+ auto app = TRY(GUI::Application::create(arguments));
Config::pledge_domain("ClipboardHistory");
Config::monitor_domain("ClipboardHistory");