diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp index d073346ed28..b6b1bcfe586 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.cpp +++ b/Userland/Libraries/LibWeb/DOM/Node.cpp @@ -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()); diff --git a/Userland/Libraries/LibWeb/DOM/Node.h b/Userland/Libraries/LibWeb/DOM/Node.h index 9e048a68927..2c5ec5e429a 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.h +++ b/Userland/Libraries/LibWeb/DOM/Node.h @@ -622,6 +622,7 @@ protected: Node(Document&, NodeType); virtual void visit_edges(Cell::Visitor&) override; + virtual void finalize() override; JS::GCPtr m_document; JS::GCPtr m_layout_node;