From b3a885755c23b76068720128fee08f8be3c63fa8 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 28 Aug 2023 18:40:20 +0200 Subject: [PATCH] LibWeb: Detach the paint tree in Document::tear_down_the_layout_tree() Otherwise, someone may try to paint the paint tree after the layout tree has been torn down. This could in theory be possible in the future, but until we've completely severed the paint tree's dependency on the layout tree, this is not safe as the layout tree is no longer in a valid state. --- Userland/Libraries/LibWeb/DOM/Document.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index dd2588a808..3ad87ce829 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -810,6 +810,8 @@ void Document::tear_down_layout_tree() } m_layout_root = nullptr; + + m_paintable = nullptr; } Color Document::background_color() const