mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00
Issue #2227 - GIMP 2.10.6 crashes with assertion GIMP_IS_TAGGED in...
...MyPaint brushes dialog In gimp_tag_entry_assign_tags(), don't add/remove tags while iterating tag_entry->selected_items, because that might change the list. Instead, make a temporary deep copy of the list and iterate the copy. Spotted by Massimo.
This commit is contained in:
parent
8f87277653
commit
ff32fe9f5d
1 changed files with 11 additions and 1 deletions
|
@ -736,6 +736,7 @@ gimp_tag_entry_assign_tags (GimpTagEntry *tag_entry)
|
|||
gint i;
|
||||
GList *resource_iter;
|
||||
GList *tag_iter;
|
||||
GList *selected_items;
|
||||
GList *dont_remove_list = NULL;
|
||||
GList *remove_list = NULL;
|
||||
GList *add_list = NULL;
|
||||
|
@ -781,7 +782,14 @@ gimp_tag_entry_assign_tags (GimpTagEntry *tag_entry)
|
|||
|
||||
g_list_free (dont_remove_list);
|
||||
|
||||
for (resource_iter = tag_entry->selected_items;
|
||||
/* duplicate tag_entry->selected_items for the add/remove loop
|
||||
* because adding/removing can change tag_entry->selected_items.
|
||||
* See Issue #2227.
|
||||
*/
|
||||
selected_items = g_list_copy_deep (tag_entry->selected_items,
|
||||
(GCopyFunc) g_object_ref, NULL);
|
||||
|
||||
for (resource_iter = selected_items;
|
||||
resource_iter;
|
||||
resource_iter = g_list_next (resource_iter))
|
||||
{
|
||||
|
@ -798,6 +806,8 @@ gimp_tag_entry_assign_tags (GimpTagEntry *tag_entry)
|
|||
}
|
||||
}
|
||||
|
||||
g_list_free_full (selected_items, (GDestroyNotify) g_object_unref);
|
||||
|
||||
g_list_free_full (add_list, (GDestroyNotify) g_object_unref);
|
||||
g_list_free_full (remove_list, (GDestroyNotify) g_object_unref);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue