summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-05-06 16:47:56 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-05-06 16:47:56 -0700
commit10c9ef771f976ff6fc55544588e7dec576387d64 (patch)
tree8b9baa95735b290e215cb69e95d13489bb5aa3f5 /src
parent4bf54d993fa4d0d0b56d24555f5a674ffbc9b232 (diff)
edje: do not check against eet if strings where never allocated.
Diffstat (limited to 'src')
-rw-r--r--src/lib/edje/edje_edit.c3
-rw-r--r--src/lib/edje/edje_private.h1
-rw-r--r--src/lib/edje/edje_textblock_styles.c7
3 files changed, 9 insertions, 2 deletions
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index e97c44f3fc..da63dd7a9f 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -821,12 +821,14 @@ _edje_if_string_free(Edje *ed, const char **str)
821 Eet_Dictionary *dict; 821 Eet_Dictionary *dict;
822 822
823 if (!ed || !str) return; 823 if (!ed || !str) return;
824 if (!ed->file->allocated_strings) goto the_end;
824 825
825 dict = eet_dictionary_get(ed->file->ef); 826 dict = eet_dictionary_get(ed->file->ef);
826 827
827 if (!eet_dictionary_string_check(dict, *str)) 828 if (!eet_dictionary_string_check(dict, *str))
828 eina_stringshare_del(*str); 829 eina_stringshare_del(*str);
829 830
831 the_end:
830 *str = NULL; 832 *str = NULL;
831} 833}
832 834
@@ -837,6 +839,7 @@ _edje_if_string_replace(Edje *ed, const char **str, const char *str_new)
837 839
838 if (!ed || !str) return; 840 if (!ed || !str) return;
839 841
842 ed->file->allocated_strings = EINA_TRUE;
840 dict = eet_dictionary_get(ed->file->ef); 843 dict = eet_dictionary_get(ed->file->ef);
841 if (*str && eet_dictionary_string_check(dict, *str)) 844 if (*str && eet_dictionary_string_check(dict, *str))
842 *str = eina_stringshare_add(str_new); 845 *str = eina_stringshare_add(str_new);
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index 4681476d58..c70f282eb4 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -577,6 +577,7 @@ struct _Edje_File
577 char fid[8+8+8+2]; 577 char fid[8+8+8+2];
578 578
579 unsigned char free_strings : 1; 579 unsigned char free_strings : 1;
580 unsigned char allocated_strings : 1;
580 unsigned char dangling : 1; 581 unsigned char dangling : 1;
581 unsigned char warning : 1; 582 unsigned char warning : 1;
582}; 583};
diff --git a/src/lib/edje/edje_textblock_styles.c b/src/lib/edje/edje_textblock_styles.c
index 0cf8a05315..2fef836378 100644
--- a/src/lib/edje/edje_textblock_styles.c
+++ b/src/lib/edje/edje_textblock_styles.c
@@ -463,7 +463,8 @@ _edje_textblock_style_parse_and_fix(Edje_File *edf)
463 /* Add and Handle tag parsed data */ 463 /* Add and Handle tag parsed data */
464 if (ts) 464 if (ts)
465 { 465 {
466 if (eet_dictionary_string_check(eet_dictionary_get(edf->ef), tag->value) == 0) 466 if (edf->allocated_strings &&
467 eet_dictionary_string_check(eet_dictionary_get(edf->ef), tag->value) == 0)
467 eina_stringshare_del(tag->value); 468 eina_stringshare_del(tag->value);
468 tag->value = eina_stringshare_add(ts); 469 tag->value = eina_stringshare_add(ts);
469 eina_strbuf_append(txt, tag->value); 470 eina_strbuf_append(txt, tag->value);
@@ -522,7 +523,9 @@ _edje_textblock_style_cleanup(Edje_File *edf)
522 523
523 EINA_LIST_FREE(stl->tags, tag) 524 EINA_LIST_FREE(stl->tags, tag)
524 { 525 {
525 if (tag->value && eet_dictionary_string_check(eet_dictionary_get(edf->ef), tag->value) == 0) 526 if (edf->allocated_strings &&
527 tag->value &&
528 eet_dictionary_string_check(eet_dictionary_get(edf->ef), tag->value) == 0)
526 eina_stringshare_del(tag->value); 529 eina_stringshare_del(tag->value);
527 if (edf->free_strings) 530 if (edf->free_strings)
528 { 531 {