gbinding: Avoid a string copy of interned property names

Interned strings are never freed, so we don’t need to take a copy of
them when returning them in a #GValue. This is a minor memory allocation
improvement, with no functional changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2019-11-12 19:31:25 +00:00
parent ae27f50342
commit 26970edc9f

View File

@ -539,7 +539,8 @@ g_binding_get_property (GObject *gobject,
break;
case PROP_SOURCE_PROPERTY:
g_value_set_string (value, binding->source_property);
/* @source_property is interned, so we dont need to take a copy */
g_value_set_static_string (value, binding->source_property);
break;
case PROP_TARGET:
@ -547,7 +548,8 @@ g_binding_get_property (GObject *gobject,
break;
case PROP_TARGET_PROPERTY:
g_value_set_string (value, binding->target_property);
/* @target_property is interned, so we dont need to take a copy */
g_value_set_static_string (value, binding->target_property);
break;
case PROP_FLAGS: