mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
Avoid modifying Object::m_children while iterating it.
This commit is contained in:
parent
e810120260
commit
aee66e0119
Notes:
sideshowbarker
2024-07-19 18:51:08 +09:00
Author: https://github.com/awesomekling
Commit: aee66e0119
1 changed files with 2 additions and 2 deletions
|
@ -13,9 +13,9 @@ Object::~Object()
|
||||||
{
|
{
|
||||||
if (m_parent)
|
if (m_parent)
|
||||||
m_parent->removeChild(*this);
|
m_parent->removeChild(*this);
|
||||||
for (auto* child : m_children) {
|
auto childrenToDelete = std::move(m_children);
|
||||||
|
for (auto* child : childrenToDelete)
|
||||||
delete child;
|
delete child;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Object::event(Event& event)
|
void Object::event(Event& event)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue