1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:37:35 +00:00

LibJS: Fix reference leak in ASTNode::append()

Using make<T> like this would create an unadopted object whose refcount
would never reach zero.
This commit is contained in:
Andreas Kling 2020-03-19 11:02:20 +01:00
parent d013753f83
commit f0b49ae04b

View file

@ -87,7 +87,7 @@ public:
template<typename T, typename... Args>
T& append(Args&&... args)
{
auto child = make<T>(forward<Args>(args)...);
auto child = create_ast_node<T>(forward<Args>(args)...);
m_children.append(move(child));
return static_cast<T&>(m_children.last());
}