mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 14:28:49 +00:00
LibJS: Don't leak class field initializers
We were storing these in Handle (strong GC roots) hanging off of ECMAScriptFunctionObject which effectively turned into world leaks.
This commit is contained in:
parent
8c809fa5ee
commit
5aa1d7837f
Notes:
github-actions[bot]
2024-11-10 18:13:56 +00:00
Author: https://github.com/awesomekling
Commit: 5aa1d7837f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2268
4 changed files with 7 additions and 6 deletions
|
@ -544,6 +544,7 @@ void ECMAScriptFunctionObject::visit_edges(Visitor& visitor)
|
|||
visitor.visit(m_bytecode_executable);
|
||||
|
||||
for (auto& field : m_fields) {
|
||||
visitor.visit(field.initializer);
|
||||
if (auto* property_key_ptr = field.name.get_pointer<PropertyKey>(); property_key_ptr && property_key_ptr->is_symbol())
|
||||
visitor.visit(property_key_ptr->as_symbol());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue