mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:37:46 +00:00
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:
parent
1dd1595043
commit
f7577585a6
1 changed files with 5 additions and 0 deletions
|
@ -71,6 +71,11 @@ protected:
|
||||||
#ifdef WEAKABLE_DEBUG
|
#ifdef WEAKABLE_DEBUG
|
||||||
m_being_destroyed = true;
|
m_being_destroyed = true;
|
||||||
#endif
|
#endif
|
||||||
|
revoke_weak_ptrs();
|
||||||
|
}
|
||||||
|
|
||||||
|
void revoke_weak_ptrs()
|
||||||
|
{
|
||||||
if (m_link)
|
if (m_link)
|
||||||
m_link->m_ptr = nullptr;
|
m_link->m_ptr = nullptr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue