mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +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
|
@ -320,8 +320,7 @@ namespace Detail {
|
||||||
template<typename T, typename Container>
|
template<typename T, typename Container>
|
||||||
inline IntrusiveListNode<T, Container>::~IntrusiveListNode()
|
inline IntrusiveListNode<T, Container>::~IntrusiveListNode()
|
||||||
{
|
{
|
||||||
if (m_storage)
|
VERIFY(!is_in_list());
|
||||||
remove();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T, typename Container>
|
template<typename T, typename Container>
|
||||||
|
|
Loading…
Reference in a new issue