mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
AK: Don't unlink intrusive list elements in the destructor
Removing the element from the intrusive linked list might not be safe if doing so requires a lock. Instead this is something the caller should have done so let's verify instead that we're not on any lists.
This commit is contained in:
parent
c46ab4fbb9
commit
96b75af5d1
Notes:
sideshowbarker
2024-07-18 17:43:33 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/96b75af5d13 Pull-request: https://github.com/SerenityOS/serenity/pull/7301 Reviewed-by: https://github.com/bgianfo ✅
1 changed files with 1 additions and 2 deletions
|
@ -320,8 +320,7 @@ namespace Detail {
|
|||
template<typename T, typename Container>
|
||||
inline IntrusiveListNode<T, Container>::~IntrusiveListNode()
|
||||
{
|
||||
if (m_storage)
|
||||
remove();
|
||||
VERIFY(!is_in_list());
|
||||
}
|
||||
|
||||
template<typename T, typename Container>
|
||||
|
|
Loading…
Add table
Reference in a new issue