CObject: add_child() should set the child's parent.

This commit is contained in:
Andreas Kling 2019-05-05 01:09:49 +02:00
parent b7cd6dea13
commit dd299fe51a
Notes: sideshowbarker 2024-07-19 14:14:30 +09:00

View file

@ -43,6 +43,9 @@ void CObject::event(CEvent& event)
void CObject::add_child(CObject& object)
{
// FIXME: Should we support reparenting objects?
ASSERT(!object.parent() || object.parent() == this);
object.m_parent = this;
m_children.append(&object);
event(*make<CChildEvent>(CEvent::ChildAdded, object));
}