cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=8692c32417c61a5d3297f35687d44fc6ed1e1747
commit 8692c32417c61a5d3297f35687d44fc6ed1e1747 Author: divyesh purohit <[email protected]> Date: Mon Jan 4 15:21:44 2016 -0800 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 <[email protected]> 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 <[email protected]> --- src/bin/test_hover.c | 2 +- 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 5f0315e..a2edea4 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 1216cc5..030aa73 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 --
