aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc
diff options
context:
space:
mode:
authorHans Petter Jansson <hpj@ximian.com>2004-04-28 06:38:31 +0800
committerHans Petter <hansp@src.gnome.org>2004-04-28 06:38:31 +0800
commita5ef985c81456fb44eb6e48be4b473caa9b8bc87 (patch)
treef7902df7496972a5481c299fddb9e078bf952a56 /widgets/misc
parent6ed604372a9894a6128ff9e982f9bf9b8328afc9 (diff)
downloadgsoc2013-evolution-a5ef985c81456fb44eb6e48be4b473caa9b8bc87.tar
gsoc2013-evolution-a5ef985c81456fb44eb6e48be4b473caa9b8bc87.tar.gz
gsoc2013-evolution-a5ef985c81456fb44eb6e48be4b473caa9b8bc87.tar.bz2
gsoc2013-evolution-a5ef985c81456fb44eb6e48be4b473caa9b8bc87.tar.lz
gsoc2013-evolution-a5ef985c81456fb44eb6e48be4b473caa9b8bc87.tar.xz
gsoc2013-evolution-a5ef985c81456fb44eb6e48be4b473caa9b8bc87.tar.zst
gsoc2013-evolution-a5ef985c81456fb44eb6e48be4b473caa9b8bc87.zip
Don't destroy item until after we know which column it is in; the sort
2004-04-27 Hans Petter Jansson <hpj@ximian.com> * gal/widgets/e-reflow.c (item_removed): Don't destroy item until after we know which column it is in; the sort comparison function might need it. Also set the newly vacant memory location at the end of the array to NULL. Fixes a crash in evo. svn path=/trunk/; revision=25646
Diffstat (limited to 'widgets/misc')
-rw-r--r--widgets/misc/e-reflow.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/widgets/misc/e-reflow.c b/widgets/misc/e-reflow.c
index cacf3848ba..b46e410d5b 100644
--- a/widgets/misc/e-reflow.c
+++ b/widgets/misc/e-reflow.c
@@ -334,14 +334,6 @@ item_removed (EReflowModel *model, int i, EReflow *reflow)
if (i < 0 || i >= reflow->count)
return;
- if (reflow->items[i])
- gtk_object_destroy (GTK_OBJECT (reflow->items[i]));
-
- memmove (reflow->heights + i, reflow->heights + i + 1, (reflow->count - i - 1) * sizeof (int));
- memmove (reflow->items + i, reflow->items + i + 1, (reflow->count - i - 1) * sizeof (GnomeCanvasItem *));
-
- reflow->count --;
-
sorted = e_sorter_model_to_sorted (E_SORTER (reflow->sorter), i);
for (c = reflow->column_count - 1; c >= 0; c--) {
int start_of_column = reflow->columns[c];
@@ -355,6 +347,17 @@ item_removed (EReflowModel *model, int i, EReflow *reflow)
}
}
+ if (reflow->items[i])
+ gtk_object_destroy (GTK_OBJECT (reflow->items[i]));
+
+ memmove (reflow->heights + i, reflow->heights + i + 1, (reflow->count - i - 1) * sizeof (int));
+ memmove (reflow->items + i, reflow->items + i + 1, (reflow->count - i - 1) * sizeof (GnomeCanvasItem *));
+
+ reflow->count --;
+
+ reflow->heights [reflow->count] = 0;
+ reflow->items [reflow->count] = NULL;
+
reflow->need_reflow_columns = TRUE;
set_empty (reflow);
e_canvas_item_request_reflow(GNOME_CANVAS_ITEM (reflow));