libgimpconfig: fix string deserialization for some cases
In gimp_config_deserialize_fundamental(), we can't use g_value_set_static_string() because that will in the end pass the GScanner's temporary scanner->value.v_string to GObject::set_property(), and depending on set_property()'s implementation, we might not dup the string (for example objects created via gimp_config_type_register() will simply use g_value_copy() and end up with a dangling pointer as a string member).
This commit is contained in:
@ -453,7 +453,7 @@ gimp_config_deserialize_fundamental (GValue *value,
|
||||
{
|
||||
case G_TYPE_STRING:
|
||||
if (scanner_string_utf8_valid (scanner, prop_spec->name))
|
||||
g_value_set_static_string (value, scanner->value.v_string);
|
||||
g_value_set_string (value, scanner->value.v_string);
|
||||
else
|
||||
return G_TOKEN_NONE;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user