diff --git a/src/core.c b/src/core.c index 6a0eb2d..f7fb2d6 100644 --- a/src/core.c +++ b/src/core.c @@ -160,7 +160,9 @@ static void MwFreeWidget(MwWidget handle) { } void MwDestroyWidget(MwWidget handle) { - arrput(handle->parent->destroy_queue, handle); + if(handle->parent != NULL) { + arrput(handle->parent->destroy_queue, handle); + } } void MwStep(MwWidget handle) {