Bug 749777 - Deleting current gradient from script leads to...

GIMP_IS_TAGGED error and possible Gimp crash (core segfault)

Remove the object from GimpTagEntry's selected_items when it is
removed from the GimpContainer.
This commit is contained in:
Michael Natterer 2015-05-31 00:31:40 +02:00
parent 4ef3c918a0
commit ae708d6419
1 changed files with 15 additions and 8 deletions

View File

@ -1210,20 +1210,27 @@ gimp_tag_entry_container_changed (GimpContainer *container,
GimpObject *object,
GimpTagEntry *tag_entry)
{
if (tag_entry->mode == GIMP_TAG_ENTRY_MODE_ASSIGN)
GList *list;
if (! gimp_container_have (GIMP_CONTAINER (tag_entry->container),
object))
{
GList *list;
GList *selected_items = NULL;
for (list = tag_entry->selected_items; list; list = g_list_next (list))
{
if (gimp_tagged_get_tags (GIMP_TAGGED (list->data)) &&
gimp_container_have (GIMP_CONTAINER (tag_entry->container),
GIMP_OBJECT (list->data)))
{
break;
}
if (list->data != object)
selected_items = g_list_prepend (selected_items, list->data);
}
selected_items = g_list_reverse (selected_items);
gimp_tag_entry_set_selected_items (tag_entry, selected_items);
g_list_free (selected_items);
}
if (tag_entry->mode == GIMP_TAG_ENTRY_MODE_ASSIGN)
{
if (! list)
{
tag_entry->internal_operation++;