From ae708d6419d6cd37c75547d86fcad35a09ce7a1f Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sun, 31 May 2015 00:31:40 +0200 Subject: [PATCH] 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. --- app/widgets/gimptagentry.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/app/widgets/gimptagentry.c b/app/widgets/gimptagentry.c index 5e1bdfd76f..17af22da79 100644 --- a/app/widgets/gimptagentry.c +++ b/app/widgets/gimptagentry.c @@ -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++;