Fix widget-boolean.c to free data on button destruction

This commit is contained in:
Geoffrey D. Bennett
2024-03-30 03:17:06 +10:30
parent fcb5028aa2
commit 05e9d9e0a2

View File

@@ -42,6 +42,10 @@ static void toggle_button_updated(
toggle_button_set_text(data->button, data->text[value]);
}
static void on_destroy(struct boolean *data) {
g_free(data);
}
GtkWidget *make_boolean_alsa_elem(
struct alsa_elem *elem,
const char *disabled_text,
@@ -78,5 +82,7 @@ GtkWidget *make_boolean_alsa_elem(
toggle_button_updated(elem, data);
g_object_weak_ref(G_OBJECT(data->button), (GWeakNotify)on_destroy, data);
return data->button;
}