mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibWeb: Don't visit DocumentShadowRootList from Document
`ShadowRoot` register itself in Document` from constructor and unregister itself from `finalize()`. The problem is that `finalize()` won't be invoked for as long as `ShadowRoot` is visited by `Document`, leading to GC leaks.
This commit is contained in:
parent
52b4f2a40a
commit
40fd2643cc
|
|
@ -605,9 +605,6 @@ void Document::visit_edges(Cell::Visitor& visitor)
|
|||
visitor.visit(m_adopted_style_sheets);
|
||||
visitor.visit(m_script_blocking_style_sheet_set);
|
||||
|
||||
for (auto& shadow_root : m_shadow_roots)
|
||||
visitor.visit(shadow_root);
|
||||
|
||||
visitor.visit(m_top_layer_elements);
|
||||
visitor.visit(m_top_layer_pending_removals);
|
||||
visitor.visit(m_showing_auto_popover_list);
|
||||
|
|
|
|||
|
|
@ -1200,6 +1200,8 @@ private:
|
|||
|
||||
mutable GC::Ptr<WebIDL::ObservableArray> m_adopted_style_sheets;
|
||||
|
||||
// Document should not visit ShadowRoot list to avoid leaks.
|
||||
// It's responsibility of object that allocated ShadowRoot to keep it alive.
|
||||
ShadowRoot::DocumentShadowRootList m_shadow_roots;
|
||||
|
||||
Optional<AK::UnixDateTime> m_last_modified;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user