[gtk+/native-layout] gtk: fix crash in _gtk_rbtree_find_offset() called from update_prelight()
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/native-layout] gtk: fix crash in _gtk_rbtree_find_offset() called from update_prelight()
- Date: Sun, 4 Apr 2010 02:24:29 +0000 (UTC)
commit ca9e02983808c037f64a905649ebaacf9f8b9702
Author: Michael Natterer <mitch gimp org>
Date: Sat Feb 6 15:57:15 2010 +0100
gtk: fix crash in _gtk_rbtree_find_offset() called from update_prelight()
Move the check for tree_view->priv->tree being NULL into update_prelight()
so the function will never call _gtk_rbtree_find_offset() on a NULL rbtree.
gtk/gtktreeview.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 5d75412..e53f8cd 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -3353,6 +3353,9 @@ update_prelight (GtkTreeView *tree_view,
GtkRBTree *tree;
GtkRBNode *node;
+ if (tree_view->priv->tree == NULL)
+ return;
+
if (x == -10000)
{
ensure_unprelighted (tree_view);
@@ -10618,10 +10621,9 @@ gtk_tree_view_adjustment_changed (GtkAdjustment *adjustment,
dy = tree_view->priv->dy - (int) tree_view->priv->vadjustment->value;
if (dy)
{
- if (tree_view->priv->tree)
- update_prelight (tree_view,
- tree_view->priv->event_last_x,
- tree_view->priv->event_last_y - dy);
+ update_prelight (tree_view,
+ tree_view->priv->event_last_x,
+ tree_view->priv->event_last_y - dy);
if (tree_view->priv->edited_column &&
GTK_IS_WIDGET (tree_view->priv->edited_column->editable_widget))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]