summaryrefslogtreecommitdiff
path: root/src/lib/edje/edje_calc.c
diff options
context:
space:
mode:
authorYeongjong Lee <yj34.lee@samsung.com>2019-04-26 14:55:37 +0900
committerSangHyeon Jade Lee <sh10233.lee@samsung.com>2019-04-26 15:33:33 +0900
commit0921e4770e4751ec9abf7757f9d11cbb5cc7f223 (patch)
tree8c9b7c88cc09e3afe2abdb6376d95b0ec01a864a /src/lib/edje/edje_calc.c
parentc006589607c78dd18ed1634f0696d63db0f47727 (diff)
edje_calc: replace eina_stringshare_ref with eina_stringshare_add
Summary: When there is circular dependency in edc, a bunch of CRI log is printed. This patch fixes it. ``` ERR<10159>:edje lib/edje/edje_calc.c:3919 _edje_part_recalc() Circular dependency in the group 'test' : longpartname -> longpartname -> longpartname2 ERR<10159>:edje lib/edje/edje_calc.c:3896 _edje_part_recalc() Circular dependency when calculating part "longpartname". Already calculating XY [03] axes. Need to calculate Y [02] axes CRI<10159>: lib/eina/eina_share_common.c:559 _eina_share_common_node_from_str() *** Eina Magic Check Failed at 0x7fb7c93ebf60 !!! Input handle is wrong type. Expected: 98761254 - Eina Stringshare Node Supplied: 2f736e6f - (unknown) CRI<10159>: lib/eina/eina_share_common.c:559 _eina_share_common_node_from_str() *** Eina Magic Check Failed at 0x7fb7c93ec5d1 !!! Input handle is wrong type. Expected: 98761254 - Eina Stringshare Node Supplied: 5f747261 - (unknown) ``` If string is already stored, `eina_stringshare_add` increase its reference count. Test Plan: test.c ``` //edje_cc test.edc && gcc -o test test.c `pkg-config --libs --cflags elementary` #include <Elementary.h> int main(int argc, char **argv) { elm_init(argc, argv); Evas_Object *win = elm_win_util_standard_add("test", "test"); Evas_Object *layout = elm_layout_add(win); elm_layout_file_set(layout, "./test.edj", "test"); elm_win_resize_object_add(win, layout); evas_object_show(layout); evas_object_resize(win, 200, 200); evas_object_show(win); elm_run(); elm_shutdown(); return 0; } ``` test.edc ``` collections { group { name: "test"; parts { rect { name: "longpartname"; desc { "default"; rel1.to: "longpartname2"; } } rect { name: "longpartname2"; type: RECT; desc { "default"; rel2.to: "longpartname"; } } } } } ``` Reviewers: SanghyeonLee, zmike Reviewed By: SanghyeonLee Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8717
Diffstat (limited to '')
-rw-r--r--src/lib/edje/edje_calc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index ffb46c075b..f0380e4fef 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -3659,7 +3659,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein
3659 rp = ed->table_parts[cep->param1.description->rel1.id_x]; 3659 rp = ed->table_parts[cep->param1.description->rel1.id_x];
3660 if (_circular_dependency_find(ed, ep, rp, arr)) 3660 if (_circular_dependency_find(ed, ep, rp, arr))
3661 { 3661 {
3662 eina_array_push(arr, eina_stringshare_ref(rp->part->name)); 3662 eina_array_push(arr, eina_stringshare_add(rp->part->name));
3663 return EINA_TRUE; 3663 return EINA_TRUE;
3664 } 3664 }
3665 } 3665 }
@@ -3668,7 +3668,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein
3668 rp = ed->table_parts[cep->param1.description->rel2.id_x]; 3668 rp = ed->table_parts[cep->param1.description->rel2.id_x];
3669 if (_circular_dependency_find(ed, ep, rp, arr)) 3669 if (_circular_dependency_find(ed, ep, rp, arr))
3670 { 3670 {
3671 eina_array_push(arr, eina_stringshare_ref(rp->part->name)); 3671 eina_array_push(arr, eina_stringshare_add(rp->part->name));
3672 return EINA_TRUE; 3672 return EINA_TRUE;
3673 } 3673 }
3674 } 3674 }
@@ -3681,7 +3681,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein
3681 rp = ed->table_parts[cep->param2->description->rel1.id_x]; 3681 rp = ed->table_parts[cep->param2->description->rel1.id_x];
3682 if (_circular_dependency_find(ed, ep, rp, arr)) 3682 if (_circular_dependency_find(ed, ep, rp, arr))
3683 { 3683 {
3684 eina_array_push(arr, eina_stringshare_ref(rp->part->name)); 3684 eina_array_push(arr, eina_stringshare_add(rp->part->name));
3685 return EINA_TRUE; 3685 return EINA_TRUE;
3686 } 3686 }
3687 } 3687 }
@@ -3690,7 +3690,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein
3690 rp = ed->table_parts[cep->param2->description->rel2.id_x]; 3690 rp = ed->table_parts[cep->param2->description->rel2.id_x];
3691 if (_circular_dependency_find(ed, ep, rp, arr)) 3691 if (_circular_dependency_find(ed, ep, rp, arr))
3692 { 3692 {
3693 eina_array_push(arr, eina_stringshare_ref(rp->part->name)); 3693 eina_array_push(arr, eina_stringshare_add(rp->part->name));
3694 return EINA_TRUE; 3694 return EINA_TRUE;
3695 } 3695 }
3696 } 3696 }
@@ -3705,7 +3705,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein
3705 rp = ed->table_parts[cep->param1.description->rel1.id_y]; 3705 rp = ed->table_parts[cep->param1.description->rel1.id_y];
3706 if (_circular_dependency_find(ed, ep, rp, arr)) 3706 if (_circular_dependency_find(ed, ep, rp, arr))
3707 { 3707 {
3708 eina_array_push(arr, eina_stringshare_ref(rp->part->name)); 3708 eina_array_push(arr, eina_stringshare_add(rp->part->name));
3709 return EINA_TRUE; 3709 return EINA_TRUE;
3710 } 3710 }
3711 } 3711 }
@@ -3714,7 +3714,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein
3714 rp = ed->table_parts[cep->param1.description->rel2.id_y]; 3714 rp = ed->table_parts[cep->param1.description->rel2.id_y];
3715 if (_circular_dependency_find(ed, ep, rp, arr)) 3715 if (_circular_dependency_find(ed, ep, rp, arr))
3716 { 3716 {
3717 eina_array_push(arr, eina_stringshare_ref(rp->part->name)); 3717 eina_array_push(arr, eina_stringshare_add(rp->part->name));
3718 return EINA_TRUE; 3718 return EINA_TRUE;
3719 } 3719 }
3720 } 3720 }
@@ -3726,7 +3726,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein
3726 rp = ed->table_parts[cep->param2->description->rel1.id_y]; 3726 rp = ed->table_parts[cep->param2->description->rel1.id_y];
3727 if (_circular_dependency_find(ed, ep, rp, arr)) 3727 if (_circular_dependency_find(ed, ep, rp, arr))
3728 { 3728 {
3729 eina_array_push(arr, eina_stringshare_ref(rp->part->name)); 3729 eina_array_push(arr, eina_stringshare_add(rp->part->name));
3730 return EINA_TRUE; 3730 return EINA_TRUE;
3731 } 3731 }
3732 } 3732 }
@@ -3735,7 +3735,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein
3735 rp = ed->table_parts[cep->param2->description->rel2.id_y]; 3735 rp = ed->table_parts[cep->param2->description->rel2.id_y];
3736 if (_circular_dependency_find(ed, ep, rp, arr)) 3736 if (_circular_dependency_find(ed, ep, rp, arr))
3737 { 3737 {
3738 eina_array_push(arr, eina_stringshare_ref(rp->part->name)); 3738 eina_array_push(arr, eina_stringshare_add(rp->part->name));
3739 return EINA_TRUE; 3739 return EINA_TRUE;
3740 } 3740 }
3741 } 3741 }