fix radiobutton destroy callback (GTK) newapi

Sat, 30 Nov 2024 20:33:16 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 30 Nov 2024 20:33:16 +0100
branch
newapi
changeset 403
b59935b2de79
parent 402
96a055be7f0b
child 404
384f6d1f5784

fix radiobutton destroy callback (GTK)

ui/gtk/button.c file | annotate | diff | comparison | revisions
--- a/ui/gtk/button.c	Sat Nov 30 20:13:09 2024 +0100
+++ b/ui/gtk/button.c	Sat Nov 30 20:33:16 2024 +0100
@@ -398,12 +398,14 @@
 } UiRadioButtonData;
 
 static void destroy_radiobutton(GtkWidget *w, UiRadioButtonData *data) {
-    ui_destroy_vardata(w, data->eventdata);
     if(data->first) {
+        ui_destroy_vardata(w, data->eventdata);
         g_slist_free(data->value->obj);
         data->value->obj = NULL;
         data->value->get = NULL;
         data->value->set = NULL;
+    } else {
+        free(data->eventdata);
     }
     free(data);
 }

mercurial