LibWeb: More thoroughly detach layout/paint trees from each other
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

Before committing a new layout (and thus building a new paint tree)
we now go through both the old paint tree and the layout tree and detach
them from each other.

This is a little extra work, but it ensures that there are no lingering
references across the trees, which we were apparently accumulating in
some cases on Discord, causing GC leaks.
This commit is contained in:
Andreas Kling 2025-07-30 16:57:03 +02:00 committed by Alexander Kalenik
commit 3b63582068
Notes: github-actions[bot] 2025-07-30 20:59:47 +00:00
3 changed files with 20 additions and 3 deletions

View file

@ -36,6 +36,12 @@ Paintable::~Paintable()
{
}
void Paintable::detach_from_layout_node()
{
if (m_list_node.is_in_list())
m_list_node.remove();
}
void Paintable::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);