shortcutsgroup: fix leak of title

like previous commit, albeit simpler this time

https://bugzilla.gnome.org/show_bug.cgi?id=772859
This commit is contained in:
Alan Jenkins 2016-10-12 16:16:57 +01:00 committed by Matthias Clasen
parent 353281d9d0
commit 8aa9339b2d

View File

@ -265,6 +265,24 @@ gtk_shortcuts_group_finalize (GObject *object)
G_OBJECT_CLASS (gtk_shortcuts_group_parent_class)->finalize (object);
}
static void
gtk_shortcuts_group_dispose (GObject *object)
{
GtkShortcutsGroup *self = GTK_SHORTCUTS_GROUP (object);
/*
* Since we overload forall(), the inherited destroy() won't work as normal.
* Remove internal widgets ourself.
*/
if (self->title)
{
gtk_widget_destroy (GTK_WIDGET (self->title));
self->title = NULL;
}
G_OBJECT_CLASS (gtk_shortcuts_group_parent_class)->dispose (object);
}
static void
gtk_shortcuts_group_class_init (GtkShortcutsGroupClass *klass)
{
@ -275,6 +293,7 @@ gtk_shortcuts_group_class_init (GtkShortcutsGroupClass *klass)
object_class->finalize = gtk_shortcuts_group_finalize;
object_class->get_property = gtk_shortcuts_group_get_property;
object_class->set_property = gtk_shortcuts_group_set_property;
object_class->dispose = gtk_shortcuts_group_dispose;
widget_class->direction_changed = gtk_shortcuts_group_direction_changed;
container_class->add = gtk_shortcuts_group_add;