mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-07 11:39:44 +03: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
Notes:
sideshowbarker
2024-07-19 01:48:16 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/5fdc8c14a6b
@ -54,12 +54,14 @@ Node::Node(Document& document, NodeType type)
|
||||
, m_document(&document)
|
||||
, m_type(type)
|
||||
{
|
||||
m_document->ref_from_node({});
|
||||
}
|
||||
|
||||
Node::~Node()
|
||||
{
|
||||
if (layout_node() && layout_node()->parent())
|
||||
layout_node()->parent()->remove_child(*layout_node());
|
||||
m_document->unref_from_node({});
|
||||
}
|
||||
|
||||
const HTML::HTMLAnchorElement* Node::enclosing_link_element() const
|
||||
|
Loading…
Reference in New Issue
Block a user