Skip to content

Commit 61a0f0f

Browse files
committed
Always set the parent for widget
Signed-off-by: Alexey Gladkov <legion@kernel.org>
1 parent 46b67ec commit 61a0f0f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/widget.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,13 @@ void widget_add(struct widget *parent, struct widget *child)
160160
if (!parent || !child)
161161
return;
162162

163+
child->parent = parent;
164+
163165
if (parent->add_child) {
164166
parent->add_child(parent, child);
165167
return;
166168
}
167169

168-
child->parent = parent;
169170
TAILQ_INSERT_TAIL(&parent->children, child, siblings);
170171
}
171172

0 commit comments

Comments
 (0)