From ffa291d6ce4ac94a0755149455de1d083243937c Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sun, 13 Apr 2003 12:27:44 +0000 Subject: [PATCH] app/core/gimpcontext.c (gimp_context_deserialize_property) g_free() the 2003-04-13 Michael Natterer * app/core/gimpcontext.c (gimp_context_deserialize_property) * app/core/gimpcontainer.c (gimp_container_deserialize): g_free() the string returned by gimp_scanner_parse_string(). Replace NULL object names by "". --- ChangeLog | 7 +++++++ app/core/gimpcontainer.c | 7 ++++++- app/core/gimpcontext.c | 13 +++++++------ 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1f75ebbf5a..e26dadfd82 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-04-13 Michael Natterer + + * app/core/gimpcontext.c (gimp_context_deserialize_property) + * app/core/gimpcontainer.c (gimp_container_deserialize): g_free() + the string returned by gimp_scanner_parse_string(). Replace + NULL object names by "". + 2003-04-13 Michael Natterer * app/tools/gimpeditselectiontool.c (init_edit_selection): diff --git a/app/core/gimpcontainer.c b/app/core/gimpcontainer.c index c1aac5e52b..5e32e5db02 100644 --- a/app/core/gimpcontainer.c +++ b/app/core/gimpcontainer.c @@ -468,7 +468,7 @@ gimp_container_deserialize (GObject *object, { GimpObject *child; GType type; - gchar *name; + gchar *name = NULL; type = g_type_from_name (scanner->value.v_identifier); @@ -503,6 +503,9 @@ gimp_container_deserialize (GObject *object, break; } + if (! name) + name = g_strdup (""); + child = gimp_container_get_child_by_name (container, name); if (! child) @@ -525,6 +528,8 @@ gimp_container_deserialize (GObject *object, g_object_unref (child); } + g_free (name); + { GimpConfigInterface *config_iface; diff --git a/app/core/gimpcontext.c b/app/core/gimpcontext.c index e63877626f..23c46000f0 100644 --- a/app/core/gimpcontext.c +++ b/app/core/gimpcontext.c @@ -1142,13 +1142,9 @@ gimp_context_serialize_property (GObject *object, gimp_config_writer_open (writer, pspec->name); if (serialize_obj) - { - gimp_config_writer_string (writer, gimp_object_get_name (serialize_obj)); - } + gimp_config_writer_string (writer, gimp_object_get_name (serialize_obj)); else - { - gimp_config_writer_print (writer, "NULL", 4); - } + gimp_config_writer_print (writer, "NULL", 4); gimp_config_writer_close (writer); @@ -1226,6 +1222,9 @@ gimp_context_deserialize_property (GObject *object, { GimpObject *deserialize_obj; + if (! object_name) + object_name = g_strdup (""); + deserialize_obj = gimp_container_get_child_by_name (container, object_name); @@ -1243,6 +1242,8 @@ gimp_context_deserialize_property (GObject *object, } g_value_set_object (value, deserialize_obj); + + g_free (object_name); } else {