[gtk+/gtk-3-22] TreeViewCol: Fix SEGV on remove/add, + memory leak



commit c0c23f7d447d5d94468abbc0717aaff342fc14c7
Author: Daniel Boles <dboles src gnome org>
Date:   Fri Oct 6 20:24:49 2017 +0100

    TreeViewCol: Fix SEGV on remove/add, + memory leak
    
    Nulling priv->button in _unset_tree_view() is asymmetrical: we create
    it via init(), not _set_tree_view(), so we shouldn’t null in the latter.
    
    Worse, doing so manifests in criticals + a SEGV easily with basic use of
    testtreecolumns, removing the TVC from a TV then trying to add it to one
    
    Finally, the wrong null-out meant dispose() failed to unref the button,
    so it leaked.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=728452
    https://bugzilla.gnome.org/show_bug.cgi?id=788614

 gtk/gtktreeviewcolumn.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c
index f3cf869..7b74dce 100644
--- a/gtk/gtktreeviewcolumn.c
+++ b/gtk/gtktreeviewcolumn.c
@@ -1431,7 +1431,6 @@ _gtk_tree_view_column_unset_tree_view (GtkTreeViewColumn *column)
     }
 
   priv->tree_view = NULL;
-  priv->button = NULL;
 }
 
 gboolean


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]