From 96b75af5d13a177fd259c4099e06690b6c478e5d Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 19 May 2021 23:42:28 +0200 Subject: [PATCH] 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. --- AK/IntrusiveList.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/AK/IntrusiveList.h b/AK/IntrusiveList.h index 875a7855ad1..43b1ca72ba5 100644 --- a/AK/IntrusiveList.h +++ b/AK/IntrusiveList.h @@ -320,8 +320,7 @@ namespace Detail { template inline IntrusiveListNode::~IntrusiveListNode() { - if (m_storage) - remove(); + VERIFY(!is_in_list()); } template