1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:37:35 +00:00

LibWeb: Add GC finalizer for DOM::Node

Now that the layout tree is also GC-allocated, we can't be messing with
it from the DOM::Node destructor. Move everything to a GC finalizer
so we know it runs before the GC sweep phase.
This commit is contained in:
Andreas Kling 2022-10-20 19:30:29 +02:00
parent 07a36c8f80
commit c877eb47a2
2 changed files with 4 additions and 1 deletions

View file

@ -73,7 +73,9 @@ Node::Node(Document& document, NodeType type)
{
}
Node::~Node()
Node::~Node() = default;
void Node::finalize()
{
if (layout_node() && layout_node()->parent())
layout_node()->parent()->remove_child(*layout_node());