mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
Kernel: Remove make_weak_ptr()
New users of WeakPtr in the kernel should use try_make_weak_ptr instead
This commit is contained in:
parent
c8ab7bde3b
commit
b32cf33a23
Notes:
sideshowbarker
2024-07-17 18:53:01 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/b32cf33a23 Pull-request: https://github.com/SerenityOS/serenity/pull/12501
2 changed files with 6 additions and 7 deletions
|
@ -105,8 +105,13 @@ private:
|
|||
class Link;
|
||||
|
||||
public:
|
||||
#ifndef KERNEL
|
||||
template<typename U = T>
|
||||
WeakPtr<U> make_weak_ptr() const { return MUST(try_make_weak_ptr<U>()); }
|
||||
WeakPtr<U> make_weak_ptr() const
|
||||
{
|
||||
return MUST(try_make_weak_ptr<U>());
|
||||
}
|
||||
#endif
|
||||
template<typename U = T>
|
||||
ErrorOr<WeakPtr<U>> try_make_weak_ptr() const;
|
||||
|
||||
|
|
|
@ -237,12 +237,6 @@ ErrorOr<WeakPtr<T>> try_make_weak_ptr_if_nonnull(T const* ptr)
|
|||
return WeakPtr<T> {};
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
WeakPtr<T> make_weak_ptr_if_nonnull(T const* ptr)
|
||||
{
|
||||
return MUST(try_make_weak_ptr_if_nonnull(ptr));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using AK::WeakPtr;
|
||||
|
|
Loading…
Reference in a new issue