textviewchild: Don't leak children

Like everybody else, GtkTextViewChild must
unparent its children in dispose.
This commit is contained in:
Matthias Clasen 2020-05-11 20:31:14 -04:00
parent d62ad4e6df
commit e516616cca

View File

@ -373,6 +373,18 @@ gtk_text_view_child_set_property (GObject *object,
}
}
static void
gtk_text_view_child_dispose (GObject *object)
{
GtkTextViewChild *self = GTK_TEXT_VIEW_CHILD (object);
GtkWidget *child;
while ((child = gtk_widget_get_first_child (GTK_WIDGET (self))))
gtk_text_view_child_remove (self, child);
G_OBJECT_CLASS (gtk_text_view_child_parent_class)->dispose (object);
}
static void
gtk_text_view_child_class_init (GtkTextViewChildClass *klass)
{
@ -380,6 +392,7 @@ gtk_text_view_child_class_init (GtkTextViewChildClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
object_class->dispose = gtk_text_view_child_dispose;
object_class->constructed = gtk_text_view_child_constructed;
object_class->get_property = gtk_text_view_child_get_property;
object_class->set_property = gtk_text_view_child_set_property;