mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:57:35 +00:00
LibWeb: Make Nodes actually ref/unref their Document
Oops, it seems like I implemented all of the "nodes keep the document alive" mechanism except the part where the functions are actually called. :^) Fixes #3811.
This commit is contained in:
parent
460d3e3969
commit
5fdc8c14a6
1 changed files with 2 additions and 0 deletions
|
@ -54,12 +54,14 @@ Node::Node(Document& document, NodeType type)
|
||||||
, m_document(&document)
|
, m_document(&document)
|
||||||
, m_type(type)
|
, m_type(type)
|
||||||
{
|
{
|
||||||
|
m_document->ref_from_node({});
|
||||||
}
|
}
|
||||||
|
|
||||||
Node::~Node()
|
Node::~Node()
|
||||||
{
|
{
|
||||||
if (layout_node() && layout_node()->parent())
|
if (layout_node() && layout_node()->parent())
|
||||||
layout_node()->parent()->remove_child(*layout_node());
|
layout_node()->parent()->remove_child(*layout_node());
|
||||||
|
m_document->unref_from_node({});
|
||||||
}
|
}
|
||||||
|
|
||||||
const HTML::HTMLAnchorElement* Node::enclosing_link_element() const
|
const HTML::HTMLAnchorElement* Node::enclosing_link_element() const
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue