From 0eef8e90874b9d6abbc346dbd7d05efcce24d9c4 Mon Sep 17 00:00:00 2001 From: zeljko Date: Sat, 29 Sep 2012 08:33:44 +0000 Subject: [PATCH] Gtk2: fixed crash in GtkIconView by unref GtkColumn which isn't GtkObject. git-svn-id: trunk@38896 - --- lcl/interfaces/gtk2/gtk2wscustomlistview.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lcl/interfaces/gtk2/gtk2wscustomlistview.inc b/lcl/interfaces/gtk2/gtk2wscustomlistview.inc index 08e769dc25..898e786913 100644 --- a/lcl/interfaces/gtk2/gtk2wscustomlistview.inc +++ b/lcl/interfaces/gtk2/gtk2wscustomlistview.inc @@ -616,9 +616,10 @@ begin else begin // No Column Needed if GtkColumn <> nil then begin - if GTK_IS_TREE_VIEW(Widgets^.MainView) then + if GTK_IS_TREE_VIEW(Widgets^.MainView) and GTK_IS_TREE_VIEW_COLUMN(GtkColumn) then gtk_tree_view_remove_column(PGtkTreeView(Widgets^.MainView), GtkColumn) else + if GTK_IS_TREE_VIEW_COLUMN(GtkColumn) and G_IS_OBJECT(GtkColumn) then g_object_unref(GtkColumn); g_object_set_data(G_OBJECT(Widgets^.MainView), 'LCL_DEFAULT_COLUMN', nil); end; @@ -731,7 +732,7 @@ begin Exit; GtkColumn := gtk_tree_view_get_column(PGtkTreeView(Widgets^.MainView), AIndex); - if GtkColumn<>nil then + if (GtkColumn<>nil) and GTK_IS_TREE_VIEW_COLUMN(GtkColumn) then gtk_tree_view_remove_column(PGtkTreeView(Widgets^.MainView), GtkColumn); end;