mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
Avoid modifying Object::m_children while iterating it.
This commit is contained in:
parent
e810120260
commit
aee66e0119
|
|
@ -13,9 +13,9 @@ Object::~Object()
|
|||
{
|
||||
if (m_parent)
|
||||
m_parent->removeChild(*this);
|
||||
for (auto* child : m_children) {
|
||||
auto childrenToDelete = std::move(m_children);
|
||||
for (auto* child : childrenToDelete)
|
||||
delete child;
|
||||
}
|
||||
}
|
||||
|
||||
void Object::event(Event& event)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user