[gtk+/gtk-3-2] GtkIconView: Fix a segfault
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-2] GtkIconView: Fix a segfault
- Date: Mon, 12 Dec 2011 15:11:15 +0000 (UTC)
commit cf028a1f7b81927b3571d500e36896f9cc8e1fb1
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Nov 23 17:49:46 2011 -0500
GtkIconView: Fix a segfault
Keynav on an empty iconview was causing segfaults. This
was reported in https://bugzilla.gnome.org/show_bug.cgi?id=664456
gtk/gtkiconview.c | 30 ++++++++++++++++++++++--------
1 files changed, 22 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 97f3f80..d60a6b4 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -3750,11 +3750,18 @@ gtk_icon_view_move_cursor_up_down (GtkIconView *icon_view,
else
list = g_list_last (icon_view->priv->items);
- item = list ? list->data : NULL;
+ if (list)
+ {
+ item = list->data;
- /* Give focus to the first cell initially */
- gtk_icon_view_set_cell_data (icon_view, item);
- gtk_cell_area_focus (icon_view->priv->cell_area, direction);
+ /* Give focus to the first cell initially */
+ gtk_icon_view_set_cell_data (icon_view, item);
+ gtk_cell_area_focus (icon_view->priv->cell_area, direction);
+ }
+ else
+ {
+ item = NULL;
+ }
}
else
{
@@ -3895,11 +3902,18 @@ gtk_icon_view_move_cursor_left_right (GtkIconView *icon_view,
else
list = g_list_last (icon_view->priv->items);
- item = list ? list->data : NULL;
+ if (list)
+ {
+ item = list->data;
- /* Give focus to the first cell initially */
- gtk_icon_view_set_cell_data (icon_view, item);
- gtk_cell_area_focus (icon_view->priv->cell_area, direction);
+ /* Give focus to the first cell initially */
+ gtk_icon_view_set_cell_data (icon_view, item);
+ gtk_cell_area_focus (icon_view->priv->cell_area, direction);
+ }
+ else
+ {
+ item = NULL;
+ }
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]