Temp fix #531: Segfault when changing width of Collection window (GTK3)
authorColin Clark <colin.clark@cclark.uk>
Sat, 28 Oct 2017 10:23:18 +0000 (11:23 +0100)
committerColin Clark <colin.clark@cclark.uk>
Sat, 28 Oct 2017 10:23:18 +0000 (11:23 +0100)
https://github.com/BestImageViewer/geeqie/issues/531

Temporary fix to stop the crash

src/collect-table.c

index 2dd3b16..ca4868f 100644 (file)
@@ -2420,6 +2420,15 @@ static void collection_table_cell_data_cb(GtkTreeViewColumn *tree_column, GtkCel
        ct = cd->ct;
 
        gtk_tree_model_get(tree_model, iter, CTABLE_COLUMN_POINTER, &list, -1);
+
+#if GTK_CHECK_VERSION(3,0,0)
+       /* FIXME this is a primitive hack to stop a crash.
+        * When compiled with GTK3, if a Collection window containing
+        * say, 50 or so, images has its width changed, there is a segfault
+        * https://github.com/BestImageViewer/geeqie/issues/531
+        */
+       if (cd->number == COLLECT_TABLE_MAX_COLUMNS) return;
+#endif
        info = g_list_nth_data(list, cd->number);
 
        style = gtk_widget_get_style(ct->listview);