eina_value_stringshare: safer copy, to cope copying user-generated structs.

array, list, struct and others set() now copies the values. These
values can be created by user, in this case string is just a stack
object and not a real eina_stringshare.

To cope with it, add the string instead of referencing it. Bit slower,
but nicer behavior.




SVN revision: 67886
This commit is contained in:
Gustavo Sverzut Barbieri 2012-02-13 16:18:47 +00:00
parent e669719714
commit 75839f61a5
1 changed files with 1 additions and 2 deletions

View File

@ -2262,8 +2262,7 @@ _eina_value_type_stringshare_copy(const Eina_Value_Type *type __UNUSED__, const
{
const char * const*s = src;
const char **d = dst;
*d = *s;
eina_stringshare_ref(*d);
*d = eina_stringshare_add(*s);
return EINA_TRUE;
}