From 476281a46b36ae0b3c18c7d4ea85d1a95d231e7f Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 2 May 2010 14:32:18 +0200 Subject: [PATCH] filechooser: Fix a crash when removing files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- gtk/gtkfilesystemmodel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c index b3328e02f9..738b061563 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 */ }