mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:47:44 +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
2 changed files with 6 additions and 7 deletions
|
@ -105,8 +105,13 @@ private:
|
||||||
class Link;
|
class Link;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
#ifndef KERNEL
|
||||||
template<typename U = T>
|
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>
|
template<typename U = T>
|
||||||
ErrorOr<WeakPtr<U>> try_make_weak_ptr() const;
|
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> {};
|
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;
|
using AK::WeakPtr;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue