mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:17:34 +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:
parent
d013753f83
commit
f0b49ae04b
1 changed files with 1 additions and 1 deletions
|
@ -87,7 +87,7 @@ public:
|
||||||
template<typename T, typename... Args>
|
template<typename T, typename... Args>
|
||||||
T& append(Args&&... 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));
|
m_children.append(move(child));
|
||||||
return static_cast<T&>(m_children.last());
|
return static_cast<T&>(m_children.last());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue