mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-10-01 03:27:36 +00:00
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>
This commit is contained in:
parent
3cc9575323
commit
bd873014ca
@ -1747,6 +1747,7 @@ remove_file (GtkFileSystemModel *model,
|
|||||||
g_object_unref (node->info);
|
g_object_unref (node->info);
|
||||||
|
|
||||||
g_array_remove_index (model->files, id);
|
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 */
|
/* We don't need to resort, as removing a row doesn't change the sorting order */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user