shortcuts section: Fix destroy

The container destroy implementation does not quite work here,
so do our own.
This commit is contained in:
Matthias Clasen 2015-11-23 19:48:50 -05:00
parent 0ed61a0480
commit 3b0ceea08b

View File

@ -208,6 +208,29 @@ gtk_shortcuts_section_unmap (GtkWidget *widget)
gtk_widget_unmap (GTK_WIDGET (self->stack));
}
static void
gtk_shortcuts_section_destroy (GtkWidget *widget)
{
GtkShortcutsSection *self = GTK_SHORTCUTS_SECTION (widget);
if (self->stack)
{
gtk_widget_destroy (GTK_WIDGET (self->stack));
self->stack = NULL;
}
if (self->footer)
{
gtk_widget_destroy (GTK_WIDGET (self->footer));
self->footer = NULL;
}
g_list_free (self->groups);
self->groups = NULL;
GTK_WIDGET_CLASS (gtk_shortcuts_section_parent_class)->destroy (widget);
}
static void
gtk_shortcuts_section_finalize (GObject *object)
{
@ -304,6 +327,7 @@ gtk_shortcuts_section_class_init (GtkShortcutsSectionClass *klass)
widget_class->map = gtk_shortcuts_section_map;
widget_class->unmap = gtk_shortcuts_section_unmap;
widget_class->destroy = gtk_shortcuts_section_destroy;
container_class->add = gtk_shortcuts_section_add;
container_class->remove = gtk_shortcuts_section_remove;