1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:58:11 +00:00

LibWeb: Visit custom element's lifecycle callbacks

...instead of using JS::Handle which causes leaks when object holding
the callback can be reached by visiting the callback's dependencies.
This commit is contained in:
Aliaksandr Kalenik 2024-03-11 19:12:52 +01:00 committed by Alexander Kalenik
parent 3d48c55e50
commit 3b4230e0b0
5 changed files with 26 additions and 5 deletions

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/HTML/CustomElements/CustomElementDefinition.h>
namespace Web::HTML {
void CustomElementDefinition::visit_edges(Visitor& visitor)
{
Base::visit_edges(visitor);
for (auto& callback : m_lifecycle_callbacks)
visitor.visit(callback.value);
}
}