mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 10:01:13 +09: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
Notes:
sideshowbarker
2024-07-19 05:11:29 +09:00
Author: https://github.com/awesomekling
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