diff options
author | divyesh purohit <div.purohit@samsung.com> | 2016-01-04 15:21:44 -0800 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2016-01-04 15:21:46 -0800 |
commit | 8692c32417c61a5d3297f35687d44fc6ed1e1747 (patch) | |
tree | ef5c50061f0bd363ab0028f17d70892c89b06691 | |
parent | bc78159ff362e6867abc2a6451af9eb84b093245 (diff) | |
download | elementary-8692c32417c61a5d3297f35687d44fc6ed1e1747.tar.gz |
hover: fix segfault when smart direction is used in content_set in hover
Summary:
when using elm_object_part_content_set(hover, "smart", content); it would cause segfault, this patch would fix T3004
Signed-off-by: divyesh purohit <div.purohit@samsung.com>
Test Plan:
please open the hover3 example in elementary for testing it, the hover
content shouldn't leave the window as "smart" direction is used.
Reviewers: shilpasingh, raster, cedric, Hermet
Subscribers: rajeshps, govi
Maniphest Tasks: T3004
Differential Revision: https://phab.enlightenment.org/D3524
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r-- | src/bin/test_hover.c | 2 | ||||
-rw-r--r-- | src/lib/elm_hover.c | 7 |
2 files changed, 2 insertions, 7 deletions
diff --git a/src/bin/test_hover.c b/src/bin/test_hover.c index 5f0315e14..a2edea4c6 100644 --- a/src/bin/test_hover.c +++ b/src/bin/test_hover.c @@ -221,7 +221,7 @@ test_hover3(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, _hover_show_cb, hv); bx = elm_box_add(win); - elm_object_part_content_set(hv, "bottom-right", bx); + elm_object_part_content_set(hv, "smart", bx); evas_object_show(bx); bt = elm_button_add(win); diff --git a/src/lib/elm_hover.c b/src/lib/elm_hover.c index 1216cc5a3..030aa73e3 100644 --- a/src/lib/elm_hover.c +++ b/src/lib/elm_hover.c @@ -232,12 +232,9 @@ _elm_hover_smt_sub_re_eval(Evas_Object *obj) prev = sd->smt_sub; _elm_hover_left_space_calc(sd, &spc_l, &spc_t, &spc_r, &spc_b); - elm_layout_content_unset(obj, sd->smt_sub->swallow); sub = sd->smt_sub->obj; - sd->smt_sub->obj = NULL; - sd->smt_sub = _elm_hover_smart_content_location_get(sd, spc_l, spc_t, spc_r, spc_b); @@ -373,9 +370,6 @@ _elm_hover_elm_widget_sub_object_del(Eo *obj, Elm_Hover_Data *sd, Evas_Object *s evas_object_event_callback_del_full (sd->smt_sub->obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_smt_sub_changed, obj); - - sd->smt_sub->obj = NULL; - sd->smt_sub = NULL; } else { @@ -397,6 +391,7 @@ _elm_hover_subs_del(Elm_Hover_Data *sd) { ELM_HOVER_PARTS_FOREACH ELM_SAFE_FREE(sd->subs[i].obj, evas_object_del); + sd->smt_sub = NULL; } EOLIAN static Eina_Bool |