+2007-11-26 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtknotebook.c (gtk_notebook_update_labels): Short-circuit on
+ destroy.
+ (gtk_notebook_destroy): Destroy tab_label widgets. (#388321, Morten
+ Welinder)
+
2007-11-26 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkassistant.c: Improve alternative button
static gboolean gtk_notebook_reorder_tab (GtkNotebook *notebook,
GtkDirectionType direction_type,
gboolean move_to_last);
+static void gtk_notebook_remove_tab_label (GtkNotebook *notebook,
+ GtkNotebookPage *page);
/*** GtkObject Methods ***/
static void gtk_notebook_destroy (GtkObject *object);
{
GtkNotebook *notebook = GTK_NOTEBOOK (object);
GtkNotebookPrivate *priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
-
+ GList *l;
+
if (notebook->menu)
gtk_notebook_popup_disable (notebook);
priv->switch_tab_timer = 0;
}
+ for (l = notebook->children; l; l = l->next)
+ {
+ GtkNotebookPage *page = l->data;
+ GtkWidget *w = page->tab_label;
+ if (w) {
+ g_object_ref (w);
+ gtk_notebook_remove_tab_label (notebook, page);
+ gtk_widget_destroy (w);
+ g_object_unref (w);
+ }
+ }
+ /*
+ * Prevent gtk_notebook_update_labels from doing work. (And from crashing
+ * since we have NULL tab_labels all over.
+ */
+ notebook->show_tabs = FALSE;
+
GTK_OBJECT_CLASS (gtk_notebook_parent_class)->destroy (object);
}
gchar string[32];
gint page_num = 1;
+ if (!notebook->show_tabs && !notebook->menu)
+ return;
+
for (list = gtk_notebook_search_page (notebook, NULL, STEP_NEXT, FALSE);
list;
list = gtk_notebook_search_page (notebook, list, STEP_NEXT, FALSE))