From 201c5f84a5b89d201ad30eb7d4c498126b0dedd5 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Fri, 24 Apr 2026 04:24:07 +0900 Subject: [PATCH] add NULL as parent for MwReparent --- src/core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core.c b/src/core.c index 1bb03a9..1307e14 100644 --- a/src/core.c +++ b/src/core.c @@ -1018,9 +1018,11 @@ void MwReparent(MwWidget handle, MwWidget new_parent) { } handle->parent = new_parent; - arrput(new_parent->children, handle); + if(new_parent != NULL) { + arrput(new_parent->children, handle); - MwDispatch(handle->parent, children_update); + MwDispatch(handle->parent, children_update); + } MwForceRender(handle); }