[gtk+/gtk-3-10] Fix life-cycle handling of treeview columns
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-10] Fix life-cycle handling of treeview columns
- Date: Sun, 6 Apr 2014 03:42:07 +0000 (UTC)
commit 1a2bd60e14d624c98928eb446155d953f984053c
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Feb 21 22:31:16 2014 -0500
Fix life-cycle handling of treeview columns
gtk_tree_view_remove_column was first removing the column from
its list, then call gtk_tree_view_column_unset_tree_view, which
would then call gtk_container_remove to remove its button from
the treeview. But the treeview remove implementation relied
on the column being still in the list in order to recognize
the button as 'special', so in effect the button was never
properly removed and thus, leaked.
Fix this by callling unset_tree_view before removing the
column from the list.
https://bugzilla.gnome.org/show_bug.cgi?id=724891
gtk/gtktreeview.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 1e99410..663e1c7 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -11923,6 +11923,11 @@ gtk_tree_view_remove_column (GtkTreeView *tree_view,
position = g_list_index (tree_view->priv->columns, column);
+ if (gtk_widget_get_realized (GTK_WIDGET (tree_view)))
+ _gtk_tree_view_column_unrealize_button (column);
+
+ _gtk_tree_view_column_unset_tree_view (column);
+
tree_view->priv->columns = g_list_remove (tree_view->priv->columns, column);
tree_view->priv->n_columns--;
@@ -11930,7 +11935,6 @@ gtk_tree_view_remove_column (GtkTreeView *tree_view,
{
GList *list;
- _gtk_tree_view_column_unrealize_button (column);
for (list = tree_view->priv->columns; list; list = list->next)
{
GtkTreeViewColumn *tmp_column;
@@ -11948,7 +11952,6 @@ gtk_tree_view_remove_column (GtkTreeView *tree_view,
}
_gtk_tree_view_reset_header_styles (tree_view);
- _gtk_tree_view_column_unset_tree_view (column);
_gtk_tree_view_accessible_remove_column (tree_view, column, position);
g_object_unref (column);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]