1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-09 03:30:46 +00:00

Avoid modifying Object::m_children while iterating it.

This commit is contained in:
Andreas Kling 2018-10-11 01:00:15 +02:00
parent e810120260
commit aee66e0119

View File

@ -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)