ui/gtk/button.c

branch
newapi
changeset 403
b59935b2de79
parent 399
bb3f3fe2d5ee
--- 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