# HG changeset patch # User Olaf Wintermann # Date 1779132596 -7200 # Node ID 0a150985d6b67c51d7b51fb955447e0af82768c2 # Parent d3a8c29ebdaa9c41648b234543f33ba6ad87fd9b fix UiObject close handling diff -r d3a8c29ebdaa -r 0a150985d6b6 ui/common/object.c --- a/ui/common/object.c Sun May 17 10:46:35 2026 +0200 +++ b/ui/common/object.c Mon May 18 21:29:56 2026 +0200 @@ -105,8 +105,9 @@ if(obj->ref == 0 || --obj->ref == 0) { if(obj->destroy) { obj->destroy(obj); + } else { + uic_object_destroy(obj); } - uic_object_destroy(obj); return 0; } return 1; diff -r d3a8c29ebdaa -r 0a150985d6b6 ui/gtk/toolkit.c --- a/ui/gtk/toolkit.c Sun May 17 10:46:35 2026 +0200 +++ b/ui/gtk/toolkit.c Mon May 18 21:29:56 2026 +0200 @@ -181,7 +181,8 @@ } void ui_close(UiObject *obj) { - uic_context_prepare_close(obj->ctx); // TODO: should this be moved to the close event handler? + uic_context_prepare_close(obj->ctx); // TODO: should this be moved to the close event handler? Yes! + /* if(obj->widget) { #if GTK_CHECK_VERSION(4, 0, 0) gtk_window_close(GTK_WINDOW(obj->widget)); @@ -191,6 +192,8 @@ } else { ui_window_close_request(obj); } + */ + ui_window_close_request(obj); }