mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-15 03:16:44 +02: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. (cherry picked from commit 5aa1d7837fe37dd203763178df3325ff8b24abbd)
This commit is contained in:
committed by
Nico Weber
parent
1b6c784b77
commit
3590a94fc4
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user