Don't leave page->tab_label dangling. (gtk_notebook_real_remove): Use

2006-03-20  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtknotebook.c (gtk_notebook_remove_tab_label): Don't leave
	page->tab_label dangling.
	(gtk_notebook_real_remove): Use GTK_IN_DESTRUCTION.
	(gtk_notebook_destroy): Leave the removal of the children
	to the container destroy method.  (#319032, Yevgen Muntyan)

2006-03-20  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkcombobox.c (gtk_combo_box_remove): Use the existing
	GTK_IN_DESTRUCTION flag, rather than roll our own.
This commit is contained in:
Matthias Clasen
2006-03-21 00:12:08 +00:00
committed by Matthias Clasen
parent 9a14641a68
commit f7dbba7b0c
4 changed files with 37 additions and 23 deletions

View File

@@ -1,3 +1,16 @@
2006-03-20 Matthias Clasen <mclasen@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_remove_tab_label): Don't leave
page->tab_label dangling.
(gtk_notebook_real_remove): Use GTK_IN_DESTRUCTION.
(gtk_notebook_destroy): Leave the removal of the children
to the container destroy method. (#319032, Yevgen Muntyan)
2006-03-20 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcombobox.c (gtk_combo_box_remove): Use the existing
GTK_IN_DESTRUCTION flag, rather than roll our own.
2006-03-20 Vladimer Sichinava <vlsichinava@gmail.com>
* configure.in: Added "ka" (Georgian) to ALL_LINGUAS

View File

@@ -1,3 +1,16 @@
2006-03-20 Matthias Clasen <mclasen@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_remove_tab_label): Don't leave
page->tab_label dangling.
(gtk_notebook_real_remove): Use GTK_IN_DESTRUCTION.
(gtk_notebook_destroy): Leave the removal of the children
to the container destroy method. (#319032, Yevgen Muntyan)
2006-03-20 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcombobox.c (gtk_combo_box_remove): Use the existing
GTK_IN_DESTRUCTION flag, rather than roll our own.
2006-03-20 Vladimer Sichinava <vlsichinava@gmail.com>
* configure.in: Added "ka" (Georgian) to ALL_LINGUAS

View File

@@ -110,7 +110,6 @@ struct _GtkComboBoxPrivate
GSList *cells;
guint popup_in_progress : 1;
guint destroying : 1;
guint add_tearoffs : 1;
guint has_frame : 1;
guint is_cell_renderer : 1;
@@ -993,7 +992,7 @@ gtk_combo_box_remove (GtkContainer *container,
gtk_widget_unparent (widget);
GTK_BIN (container)->child = NULL;
if (combo_box->priv->destroying)
if (GTK_OBJECT_FLAGS (combo_box) & GTK_IN_DESTRUCTION)
return;
gtk_widget_queue_resize (GTK_WIDGET (container));
@@ -4846,12 +4845,8 @@ gtk_combo_box_destroy (GtkObject *object)
combo_box->priv->row_separator_data = NULL;
combo_box->priv->row_separator_destroy = NULL;
combo_box->priv->destroying = 1;
GTK_OBJECT_CLASS (parent_class)->destroy (object);
combo_box->priv->cell_view = NULL;
combo_box->priv->destroying = 0;
}
static void

View File

@@ -216,8 +216,7 @@ static void gtk_notebook_forall (GtkContainer *container,
static void gtk_notebook_redraw_tabs (GtkNotebook *notebook);
static void gtk_notebook_redraw_arrows (GtkNotebook *notebook);
static void gtk_notebook_real_remove (GtkNotebook *notebook,
GList *list,
gboolean destroying);
GList *list);
static void gtk_notebook_update_labels (GtkNotebook *notebook);
static gint gtk_notebook_timer (GtkNotebook *notebook);
static gint gtk_notebook_page_compare (gconstpointer a,
@@ -888,21 +887,11 @@ gtk_notebook_new (void)
static void
gtk_notebook_destroy (GtkObject *object)
{
GList *children;
GtkNotebook *notebook = GTK_NOTEBOOK (object);
if (notebook->menu)
gtk_notebook_popup_disable (notebook);
children = notebook->children;
while (children)
{
GList *child = children;
children = child->next;
gtk_notebook_real_remove (notebook, child, TRUE);
}
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
@@ -2292,7 +2281,7 @@ gtk_notebook_remove (GtkContainer *container,
page = children->data;
if (page->child == widget)
{
gtk_notebook_real_remove (notebook, children, FALSE);
gtk_notebook_real_remove (notebook, children);
break;
}
children = children->next;
@@ -2697,18 +2686,22 @@ gtk_notebook_remove_tab_label (GtkNotebook *notebook,
gtk_widget_set_state (page->tab_label, GTK_STATE_NORMAL);
gtk_widget_unparent (page->tab_label);
page->tab_label = NULL;
}
}
static void
gtk_notebook_real_remove (GtkNotebook *notebook,
GList *list,
gboolean destroying)
GList *list)
{
GtkNotebookPage *page;
GList * next_list;
gint need_resize = FALSE;
gboolean destroying;
destroying = GTK_OBJECT_FLAGS (notebook) & GTK_IN_DESTRUCTION;
next_list = gtk_notebook_search_page (notebook, list, STEP_PREV, TRUE);
if (!next_list)
next_list = gtk_notebook_search_page (notebook, list, STEP_NEXT, TRUE);
@@ -4516,13 +4509,13 @@ gtk_notebook_remove_page (GtkNotebook *notebook,
{
list = g_list_nth (notebook->children, page_num);
if (list)
gtk_notebook_real_remove (notebook, list, FALSE);
gtk_notebook_real_remove (notebook, list);
}
else
{
list = g_list_last (notebook->children);
if (list)
gtk_notebook_real_remove (notebook, list, FALSE);
gtk_notebook_real_remove (notebook, list);
}
}