1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:47:45 +00:00

AK: RefPtr::operator=(RefPtr<U>&&) needs to cast the incoming pointer.

Otherwise it's not possible to assign a RefPtr<Derived>&& to a RefPtr<Base>.
This commit is contained in:
Andreas Kling 2019-07-21 11:36:22 +02:00
parent aeae1cb5e2
commit fa6f601170

View file

@ -108,7 +108,7 @@ public:
{ {
if (this != static_cast<void*>(&other)) { if (this != static_cast<void*>(&other)) {
deref_if_not_null(m_ptr); deref_if_not_null(m_ptr);
m_ptr = other.leak_ref(); m_ptr = static_cast<T*>(other.leak_ref());
} }
return *this; return *this;
} }