diff --git a/AK/WeakPtr.h b/AK/WeakPtr.h index 1b8297b356..290a12a0b7 100644 --- a/AK/WeakPtr.h +++ b/AK/WeakPtr.h @@ -18,14 +18,14 @@ public: template WeakPtr(WeakPtr&& other) - : m_link(reinterpret_cast*>(other.leak_link())) + : m_link(reinterpret_cast*>(other.take_link().ptr())) { } template WeakPtr& operator=(WeakPtr&& other) { - m_link = reinterpret_cast*>(other.leak_link()); + m_link = reinterpret_cast*>(other.take_link().ptr()); return *this; } @@ -46,7 +46,7 @@ public: bool is_null() const { return !m_link || !m_link->ptr(); } void clear() { m_link = nullptr; } - WeakLink* leak_link() { return m_link.leak_ref(); } + RefPtr> take_link() { return move(m_link); } bool operator==(const OwnPtr& other) const { return ptr() == other.ptr(); }