mirror of
https://github.com/RGBCube/serenity
synced 2025-07-04 17:47:36 +00:00
LibWeb: Use JS::HeapFunction for DocumentObserver callbacks
If GC-allocated object wants to own a function it should use HeapFunction because using SafeFunction will almost always lead to a leak.
This commit is contained in:
parent
12adaac08d
commit
cad2d2c85b
4 changed files with 24 additions and 6 deletions
|
@ -34,9 +34,9 @@ void SVGUseElement::initialize(JS::Realm& realm)
|
|||
set_shadow_root(shadow_root);
|
||||
|
||||
m_document_observer = realm.heap().allocate<DOM::DocumentObserver>(realm, realm, document());
|
||||
m_document_observer->document_completely_loaded = [this]() {
|
||||
m_document_observer->set_document_completely_loaded([this]() {
|
||||
clone_element_tree_as_our_shadow_tree(referenced_element());
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
void SVGUseElement::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue