diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2022-02-13 20:47:36 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-13 23:02:57 +0100 |
commit | d6ea6c39a77c092ef32ffec2055065eed93f9daf (patch) | |
tree | 603d6e82598cb2e03731158163b5c62ff9000d9a /Userland/Libraries/LibGUI/CommonActions.cpp | |
parent | bfe1bd9726779fb324fe3f7bc3dde33fd1295fe6 (diff) | |
download | serenity-d6ea6c39a77c092ef32ffec2055065eed93f9daf.zip |
AK+Kernel: Rename try_make_weak_ptr to make_weak_ptr_if_nonnull
This matches the likes of the adopt_{own, ref}_if_nonnull family and
also frees up the name to allow us to eventually add OOM-fallible
versions of these functions.
Diffstat (limited to 'Userland/Libraries/LibGUI/CommonActions.cpp')
-rw-r--r-- | Userland/Libraries/LibGUI/CommonActions.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGUI/CommonActions.cpp b/Userland/Libraries/LibGUI/CommonActions.cpp index 8fbd5aaa1d..27c3e8cfb8 100644 --- a/Userland/Libraries/LibGUI/CommonActions.cpp +++ b/Userland/Libraries/LibGUI/CommonActions.cpp @@ -17,7 +17,7 @@ namespace CommonActions { NonnullRefPtr<Action> make_about_action(const String& app_name, const Icon& app_icon, Window* parent) { - auto weak_parent = AK::try_make_weak_ptr<Window>(parent); + auto weak_parent = AK::make_weak_ptr_if_nonnull<Window>(parent); auto action = Action::create(String::formatted("&About {}", app_name), app_icon.bitmap_for_size(16), [=](auto&) { AboutDialog::show(app_name, app_icon.bitmap_for_size(32), weak_parent.ptr()); }); |