[gtk+/gtk-2-20] filechooser: Fix a crash when removing files
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-20] filechooser: Fix a crash when removing files
- Date: Sun, 2 May 2010 12:45:07 +0000 (UTC)
commit 476281a46b36ae0b3c18c7d4ea85d1a95d231e7f
Author: Benjamin Otte <otte redhat com>
Date: Sun May 2 14:32:18 2010 +0200
filechooser: Fix a crash when removing files
The file removal code was not properly clearing the file=>array index
cache, so later lookups into that cache would return invalid array
indexes.
The easiest way to reproduce it is to create a directory with two files
and deleting both of them.
Reported-by: Javier Jardón <jjardon gnome org>
gtk/gtkfilesystemmodel.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c
index b3328e0..738b061 100644
--- a/gtk/gtkfilesystemmodel.c
+++ b/gtk/gtkfilesystemmodel.c
@@ -1747,6 +1747,7 @@ remove_file (GtkFileSystemModel *model,
g_object_unref (node->info);
g_array_remove_index (model->files, id);
+ g_hash_table_remove_all (model->file_lookup);
/* We don't need to resort, as removing a row doesn't change the sorting order */
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]