Kernel: Remove make_weak_ptr()

New users of WeakPtr in the kernel should use try_make_weak_ptr instead
This commit is contained in:
Idan Horowitz 2022-02-13 21:34:11 +02:00 committed by Andreas Kling
parent c8ab7bde3b
commit b32cf33a23
Notes: sideshowbarker 2024-07-17 18:53:01 +09:00
2 changed files with 6 additions and 7 deletions

View file

@ -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;

View file

@ -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;