From ca0874073866cbaedd68f9084d0ec1fab8f10686 Mon Sep 17 00:00:00 2001 From: barbieri Date: Mon, 13 Feb 2012 16:18:47 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@67886 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/eina_value.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/eina_value.c b/src/lib/eina_value.c index 495aab9..8458afd 100644 --- a/src/lib/eina_value.c +++ b/src/lib/eina_value.c @@ -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; } -- 2.7.4