Fixed crash, caused by flagged for autofixed width tree columns

pull/32/head
Ivan Dmitrievich Yartsev 11 months ago
parent 05f6fab9e7
commit a31900d582

@ -158,9 +158,12 @@ struct fixed_info {
int size;
};
void yon_on_fixed_changed(GtkTreeViewColumn *self, GParamSpec*,struct fixed_info *info);
void on_row_fixed_changed(GtkTreeModel* self, GtkTreePath* path, GtkTreeIter* iter, struct fixed_info *info){
for (int i=0;i<info->size;i++){
g_signal_handlers_block_by_func(G_OBJECT(gtk_tree_view_get_column(GTK_TREE_VIEW(info->target),info->columns[i])),yon_on_fixed_changed,info);
yon_gtk_tree_view_column_set_fixed_size(GTK_TREE_VIEW(info->target),info->columns[i]);
g_signal_handlers_unblock_by_func(G_OBJECT(gtk_tree_view_get_column(GTK_TREE_VIEW(info->target),info->columns[i])),yon_on_fixed_changed,info);
}
}
@ -168,7 +171,9 @@ void on_row_fixed_changed(GtkTreeModel* self, GtkTreePath* path, GtkTreeIter* it
void on_row_fixed_deleted(GtkTreeModel* self, GtkTreePath* path, struct fixed_info *info){
for (int i=0;i<info->size;i++){
g_signal_handlers_block_by_func(G_OBJECT(gtk_tree_view_get_column(GTK_TREE_VIEW(info->target),info->columns[i])),yon_on_fixed_changed,info);
yon_gtk_tree_view_column_set_fixed_size(GTK_TREE_VIEW(info->target),info->columns[i]);
g_signal_handlers_unblock_by_func(G_OBJECT(gtk_tree_view_get_column(GTK_TREE_VIEW(info->target),info->columns[i])),yon_on_fixed_changed,info);
}
}
@ -190,6 +195,7 @@ void yon_on_fixed_changed(GtkTreeViewColumn *self, GParamSpec*,struct fixed_info
free(info->columns);
free(info);
}
g_signal_handlers_disconnect_by_func(self,yon_on_fixed_changed,info);
return;
}
}

Loading…
Cancel
Save