mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 20:42:11 +02:00
LibWeb: Make CustomElementDefinition relationship with GC more sane
1. Stop using GC::Root in member variables, since that usually creates a realm leak. 2. Stop putting OrderedHashMap<FlyString, GC::Ptr> on the stack while setting these up, since that won't protect the objects from GC.
This commit is contained in:
committed by
Andreas Kling
parent
062e33438e
commit
ceefe7d858
Notes:
github-actions[bot]
2024-12-27 09:03:54 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/ceefe7d858d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3049
@@ -13,6 +13,11 @@ void CustomElementDefinition::visit_edges(Visitor& visitor)
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_constructor);
|
||||
visitor.visit(m_lifecycle_callbacks);
|
||||
for (auto& entry : m_construction_stack) {
|
||||
entry.visit(
|
||||
[&](GC::Ref<DOM::Element>& element) { visitor.visit(element); },
|
||||
[&](AlreadyConstructedCustomElementMarker&) {});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user