From 12e531f512b03bc401930fe3af9158fc571d7e2c Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Mon, 31 Jan 2011 23:53:59 +0100 Subject: [PATCH] app: gimp_item_replace_item(): if the item has an ID, remove it from the item hash --- app/core/gimpitem.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/core/gimpitem.c b/app/core/gimpitem.c index 620c29d2a0..a927933fb8 100644 --- a/app/core/gimpitem.c +++ b/app/core/gimpitem.c @@ -1674,6 +1674,10 @@ gimp_item_replace_item (GimpItem *item, gimp_object_set_name (GIMP_OBJECT (item), gimp_object_get_name (replace)); + if (private->ID) + g_hash_table_remove (gimp_item_get_image (item)->gimp->item_table, + GINT_TO_POINTER (gimp_item_get_ID (item))); + private->ID = gimp_item_get_ID (replace); g_hash_table_replace (gimp_item_get_image (item)->gimp->item_table, GINT_TO_POINTER (gimp_item_get_ID (item)),