mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +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
Notes:
sideshowbarker
2024-07-19 05:11:29 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f7577585a67
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue