plug leak introduced with last commit: simply always use the deserialized

2007-02-11  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpcontainer.c (gimp_container_deserialize): plug leak
	introduced with last commit: simply always use the deserialized
	name, also on ojects already existing in the container.


svn path=/trunk/; revision=21890
This commit is contained in:
Michael Natterer 2007-02-11 12:48:41 +00:00 committed by Michael Natterer
parent 287331b36f
commit b1093d65a3
2 changed files with 14 additions and 22 deletions

View File

@ -1,3 +1,9 @@
2007-02-11 Michael Natterer <mitch@gimp.org>
* app/core/gimpcontainer.c (gimp_container_deserialize): plug leak
introduced with last commit: simply always use the deserialized
name, also on ojects already existing in the container.
2007-02-10 Sven Neumann <sven@gimp.org> 2007-02-10 Sven Neumann <sven@gimp.org>
* modules/controller_linux_input.c * modules/controller_linux_input.c

View File

@ -431,32 +431,18 @@ gimp_container_deserialize (GimpConfig *config,
if (! child) if (! child)
{ {
if (GIMP_IS_GIMP (data)) if (GIMP_IS_GIMP (data))
{ child = g_object_new (type, "gimp", data, NULL);
child = g_object_new (type,
"name", name,
"gimp", data, NULL);
}
else else
{ child = g_object_new (type, NULL);
child = g_object_new (type,
"name", name, NULL);
}
add_child = TRUE; add_child = TRUE;
} }
else if (strcmp (name, gimp_object_get_name (child)))
{ /* always use the deserialized name. while it normally
/* we found the child by name, but the name isn't the same? * doesn't make a difference there are obscure case like
* this must be an obscure case like template migration, * template migration.
* so set the deserialized name on the already existing */
* object. gimp_object_take_name (child, name);
*/
gimp_object_take_name (child, name);
}
else
{
g_free (name);
}
if (! GIMP_CONFIG_GET_INTERFACE (child)->deserialize (GIMP_CONFIG (child), if (! GIMP_CONFIG_GET_INTERFACE (child)->deserialize (GIMP_CONFIG (child),
scanner, scanner,