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>
This commit is contained in:
divyesh purohit 2016-01-04 15:21:44 -08:00 committed by Cedric BAIL
parent 9fd9a33b7a
commit e6b686b493
2 changed files with 2 additions and 7 deletions

View File

@ -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);

View File

@ -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