AK: Add Weakable::revoke_weak_ptrs()

This allows you to clear all the WeakPtrs pointing at a Weakable *now*
instead of waiting until the Weakable is destroyed.
This commit is contained in:
Andreas Kling 2020-07-04 16:22:32 +02:00
parent 1dd1595043
commit f7577585a6
Notes: sideshowbarker 2024-07-19 05:11:29 +09:00

View file

@ -71,6 +71,11 @@ protected:
#ifdef WEAKABLE_DEBUG
m_being_destroyed = true;
#endif
revoke_weak_ptrs();
}
void revoke_weak_ptrs()
{
if (m_link)
m_link->m_ptr = nullptr;
}