mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
CObject: add_child() should set the child's parent.
This commit is contained in:
parent
b7cd6dea13
commit
dd299fe51a
Notes:
sideshowbarker
2024-07-19 14:14:30 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/dd299fe51a6
1 changed files with 3 additions and 0 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue