forked from enlightenment/efl
edje: do not check against eet if strings where never allocated.
This commit is contained in:
parent
4bf54d993f
commit
10c9ef771f
|
@ -821,12 +821,14 @@ _edje_if_string_free(Edje *ed, const char **str)
|
|||
Eet_Dictionary *dict;
|
||||
|
||||
if (!ed || !str) return;
|
||||
if (!ed->file->allocated_strings) goto the_end;
|
||||
|
||||
dict = eet_dictionary_get(ed->file->ef);
|
||||
|
||||
if (!eet_dictionary_string_check(dict, *str))
|
||||
eina_stringshare_del(*str);
|
||||
|
||||
the_end:
|
||||
*str = NULL;
|
||||
}
|
||||
|
||||
|
@ -837,6 +839,7 @@ _edje_if_string_replace(Edje *ed, const char **str, const char *str_new)
|
|||
|
||||
if (!ed || !str) return;
|
||||
|
||||
ed->file->allocated_strings = EINA_TRUE;
|
||||
dict = eet_dictionary_get(ed->file->ef);
|
||||
if (*str && eet_dictionary_string_check(dict, *str))
|
||||
*str = eina_stringshare_add(str_new);
|
||||
|
|
|
@ -577,6 +577,7 @@ struct _Edje_File
|
|||
char fid[8+8+8+2];
|
||||
|
||||
unsigned char free_strings : 1;
|
||||
unsigned char allocated_strings : 1;
|
||||
unsigned char dangling : 1;
|
||||
unsigned char warning : 1;
|
||||
};
|
||||
|
|
|
@ -463,7 +463,8 @@ _edje_textblock_style_parse_and_fix(Edje_File *edf)
|
|||
/* Add and Handle tag parsed data */
|
||||
if (ts)
|
||||
{
|
||||
if (eet_dictionary_string_check(eet_dictionary_get(edf->ef), tag->value) == 0)
|
||||
if (edf->allocated_strings &&
|
||||
eet_dictionary_string_check(eet_dictionary_get(edf->ef), tag->value) == 0)
|
||||
eina_stringshare_del(tag->value);
|
||||
tag->value = eina_stringshare_add(ts);
|
||||
eina_strbuf_append(txt, tag->value);
|
||||
|
@ -522,7 +523,9 @@ _edje_textblock_style_cleanup(Edje_File *edf)
|
|||
|
||||
EINA_LIST_FREE(stl->tags, tag)
|
||||
{
|
||||
if (tag->value && eet_dictionary_string_check(eet_dictionary_get(edf->ef), tag->value) == 0)
|
||||
if (edf->allocated_strings &&
|
||||
tag->value &&
|
||||
eet_dictionary_string_check(eet_dictionary_get(edf->ef), tag->value) == 0)
|
||||
eina_stringshare_del(tag->value);
|
||||
if (edf->free_strings)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue