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:
Gunnar Beutner 2021-05-19 23:42:28 +02:00 committed by Andreas Kling
parent c46ab4fbb9
commit 96b75af5d1
Notes: sideshowbarker 2024-07-18 17:43:33 +09:00

View File

@ -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>