summaryrefslogtreecommitdiff
path: root/gtk/gtktreeselection.c
diff options
context:
space:
mode:
authorMichael Natterer <mitch@gimp.org>2003-04-14 12:02:57 +0000
committerMichael Natterer <mitch@src.gnome.org>2003-04-14 12:02:57 +0000
commitb45f8ef2509ea989b090074c3104a2c986d95a10 (patch)
tree77aac189d991ce598108b0ab29914aea12f1806b /gtk/gtktreeselection.c
parent9f53ec5d3b73bbfd71a35f8e8f975140d1857f0b (diff)
downloadgtk+-b45f8ef2509ea989b090074c3104a2c986d95a10.tar.gz
added checks to ensure that the iter is not reordered to its own position.
2003-04-14 Michael Natterer <mitch@gimp.org> * gtk/gtkliststore.c (gtk_list_store_move): added checks to ensure that the iter is not reordered to its own position. Prevents model corruption for the case that the store contains only a single item (fixes bug #108387). Unrelated: * gtk/gtkliststore.c (gtk_list_store_insert): g_list_alloc() the new list element later so we don't leak it if we decide to return early. * gtk/gtktreeselection.c (_gtk_tree_selection_internal_select_node): set selection->tree_view->priv->anchor to NULL after freeing it.
Diffstat (limited to 'gtk/gtktreeselection.c')
-rw-r--r--gtk/gtktreeselection.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk/gtktreeselection.c b/gtk/gtktreeselection.c
index f2fe18bb28..424ba9c9ae 100644
--- a/gtk/gtktreeselection.c
+++ b/gtk/gtktreeselection.c
@@ -1348,7 +1348,11 @@ _gtk_tree_selection_internal_select_node (GtkTreeSelection *selection,
if (dirty)
{
if (selection->tree_view->priv->anchor)
- gtk_tree_row_reference_free (selection->tree_view->priv->anchor);
+ {
+ gtk_tree_row_reference_free (selection->tree_view->priv->anchor);
+ selection->tree_view->priv->anchor = NULL;
+ }
+
if (gtk_tree_selection_real_select_node (selection, tree, node, TRUE))
{
selection->tree_view->priv->anchor =