summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordivyesh purohit <div.purohit@samsung.com>2016-01-04 15:21:44 -0800
committerCedric BAIL <cedric@osg.samsung.com>2016-01-04 15:21:46 -0800
commit8692c32417c61a5d3297f35687d44fc6ed1e1747 (patch)
treeef5c50061f0bd363ab0028f17d70892c89b06691
parentbc78159ff362e6867abc2a6451af9eb84b093245 (diff)
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.c2
-rw-r--r--src/lib/elm_hover.c7
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,
221 _hover_show_cb, hv); 221 _hover_show_cb, hv);
222 222
223 bx = elm_box_add(win); 223 bx = elm_box_add(win);
224 elm_object_part_content_set(hv, "bottom-right", bx); 224 elm_object_part_content_set(hv, "smart", bx);
225 evas_object_show(bx); 225 evas_object_show(bx);
226 226
227 bt = elm_button_add(win); 227 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)
232 prev = sd->smt_sub; 232 prev = sd->smt_sub;
233 233
234 _elm_hover_left_space_calc(sd, &spc_l, &spc_t, &spc_r, &spc_b); 234 _elm_hover_left_space_calc(sd, &spc_l, &spc_t, &spc_r, &spc_b);
235 elm_layout_content_unset(obj, sd->smt_sub->swallow);
236 235
237 sub = sd->smt_sub->obj; 236 sub = sd->smt_sub->obj;
238 237
239 sd->smt_sub->obj = NULL;
240
241 sd->smt_sub = 238 sd->smt_sub =
242 _elm_hover_smart_content_location_get(sd, spc_l, spc_t, spc_r, spc_b); 239 _elm_hover_smart_content_location_get(sd, spc_l, spc_t, spc_r, spc_b);
243 240
@@ -373,9 +370,6 @@ _elm_hover_elm_widget_sub_object_del(Eo *obj, Elm_Hover_Data *sd, Evas_Object *s
373 evas_object_event_callback_del_full 370 evas_object_event_callback_del_full
374 (sd->smt_sub->obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, 371 (sd->smt_sub->obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
375 _on_smt_sub_changed, obj); 372 _on_smt_sub_changed, obj);
376
377 sd->smt_sub->obj = NULL;
378 sd->smt_sub = NULL;
379 } 373 }
380 else 374 else
381 { 375 {
@@ -397,6 +391,7 @@ _elm_hover_subs_del(Elm_Hover_Data *sd)
397{ 391{
398 ELM_HOVER_PARTS_FOREACH 392 ELM_HOVER_PARTS_FOREACH
399 ELM_SAFE_FREE(sd->subs[i].obj, evas_object_del); 393 ELM_SAFE_FREE(sd->subs[i].obj, evas_object_del);
394 sd->smt_sub = NULL;
400} 395}
401 396
402EOLIAN static Eina_Bool 397EOLIAN static Eina_Bool