colorchooserdialog: Fix disposing

We need to drop our widgetry in dispose to prevent
leakage.
This commit is contained in:
Matthias Clasen 2020-05-09 14:14:55 -04:00
parent b6bfeb786f
commit 4b144855b9

View File

@ -191,12 +191,23 @@ gtk_color_chooser_dialog_set_property (GObject *object,
} }
} }
static void
gtk_color_chooser_dialog_dispose (GObject *object)
{
GtkColorChooserDialog *cc = GTK_COLOR_CHOOSER_DIALOG (object);
g_clear_pointer (&cc->chooser, gtk_widget_unparent);
G_OBJECT_CLASS (gtk_color_chooser_dialog_parent_class)->dispose (object);
}
static void static void
gtk_color_chooser_dialog_class_init (GtkColorChooserDialogClass *class) gtk_color_chooser_dialog_class_init (GtkColorChooserDialogClass *class)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (class); GObjectClass *object_class = G_OBJECT_CLASS (class);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
object_class->dispose = gtk_color_chooser_dialog_dispose;
object_class->get_property = gtk_color_chooser_dialog_get_property; object_class->get_property = gtk_color_chooser_dialog_get_property;
object_class->set_property = gtk_color_chooser_dialog_set_property; object_class->set_property = gtk_color_chooser_dialog_set_property;