# HG changeset patch # User Olaf Wintermann # Date 1779207953 -7200 # Node ID f0def0c24ae6ce182f9a11eff81485391253a268 # Parent a4affe75198c60fd1e6ad2835602716b3141c169 make sure uic_context_prepare_close is called before the window is destroyed (GTK) diff -r a4affe75198c -r f0def0c24ae6 ui/common/object.c --- a/ui/common/object.c Tue May 19 18:10:13 2026 +0200 +++ b/ui/common/object.c Tue May 19 18:25:53 2026 +0200 @@ -103,6 +103,7 @@ // it is possible to have 0 references, in case // a window was created but ui_show was never called if(obj->ref == 0 || --obj->ref == 0) { + uic_context_prepare_close(obj->ctx); if(obj->destroy) { obj->destroy(obj); } else { @@ -114,7 +115,6 @@ } void uic_object_destroy(UiObject *obj) { - uic_context_prepare_close(obj->ctx); uic_object_destroyed(obj); uic_context_destroy(obj->ctx, obj->ctx->document); } diff -r a4affe75198c -r f0def0c24ae6 ui/gtk/window.c --- a/ui/gtk/window.c Tue May 19 18:10:13 2026 +0200 +++ b/ui/gtk/window.c Tue May 19 18:25:53 2026 +0200 @@ -126,18 +126,6 @@ #endif return TRUE; } else { - if(obj->ctx->close_callback) { - UiEvent ev; - ev.window = obj->window; - ev.document = obj->ctx->document; - ev.obj = obj; - ev.eventdata = NULL; - ev.eventdatatype = 0; - ev.intval = 0; - obj->ctx->close_callback(&ev, obj->ctx->close_data); - obj->ctx->close_callback = NULL; - } - uic_context_prepare_close(obj->ctx); return FALSE; }