summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@yahoo.com>2016-11-21 11:52:27 +0200
committerDaniel Zaoui <daniel.zaoui@yahoo.com>2016-11-21 12:24:16 +0200
commit381d93f1e2c9387ce101b2bbdedf29ee15ae91c0 (patch)
tree9ad0c994950ff170b0a0ab9e978f00db2bf84549
parent90c7a95a546e08e406a71cc1f85e2607f1b54af3 (diff)
efl_ui_image: fix removal of the internal evas image
During the replacement of the image with the new preloaded one, the previous image is deleted but not removed from the list of children of the icon (efl_ui_image), leading to Eo errors when walking over the icon children. @fix
-rw-r--r--src/lib/elementary/efl_ui_image.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c
index f874020b7b..ccdb3f8fb4 100644
--- a/src/lib/elementary/efl_ui_image.c
+++ b/src/lib/elementary/efl_ui_image.c
@@ -63,6 +63,15 @@ struct _Async_Open_Data
63}; 63};
64 64
65static void 65static void
66_prev_img_del(Efl_Ui_Image_Data *sd)
67{
68 elm_widget_sub_object_del(sd->self, sd->prev_img);
69 evas_object_smart_member_del(sd->prev_img);
70 evas_object_del(sd->prev_img);
71 sd->prev_img = NULL;
72}
73
74static void
66_on_image_preloaded(void *data, 75_on_image_preloaded(void *data,
67 Evas *e EINA_UNUSED, 76 Evas *e EINA_UNUSED,
68 Evas_Object *obj, 77 Evas_Object *obj,
@@ -73,7 +82,7 @@ _on_image_preloaded(void *data,
73 82
74 sd->preload_status = EFL_UI_IMAGE_PRELOADED; 83 sd->preload_status = EFL_UI_IMAGE_PRELOADED;
75 if (sd->show) evas_object_show(obj); 84 if (sd->show) evas_object_show(obj);
76 ELM_SAFE_FREE(sd->prev_img, evas_object_del); 85 _prev_img_del(sd);
77 err = evas_object_image_load_error_get(obj); 86 err = evas_object_image_load_error_get(obj);
78 if (!err) evas_object_smart_callback_call(sd->self, SIG_LOAD_READY, NULL); 87 if (!err) evas_object_smart_callback_call(sd->self, SIG_LOAD_READY, NULL);
79 else evas_object_smart_callback_call(sd->self, SIG_LOAD_ERROR, NULL); 88 else evas_object_smart_callback_call(sd->self, SIG_LOAD_ERROR, NULL);
@@ -432,7 +441,7 @@ _efl_ui_image_edje_file_set(Evas_Object *obj,
432 441
433 EFL_UI_IMAGE_DATA_GET(obj, sd); 442 EFL_UI_IMAGE_DATA_GET(obj, sd);
434 443
435 ELM_SAFE_FREE(sd->prev_img, evas_object_del); 444 _prev_img_del(sd);
436 445
437 if (!sd->edje) 446 if (!sd->edje)
438 { 447 {
@@ -551,7 +560,7 @@ _efl_ui_image_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Image_Data *sd)
551{ 560{
552 ecore_timer_del(sd->anim_timer); 561 ecore_timer_del(sd->anim_timer);
553 evas_object_del(sd->img); 562 evas_object_del(sd->img);
554 evas_object_del(sd->prev_img); 563 _prev_img_del(sd);
555 if (sd->remote) _elm_url_cancel(sd->remote); 564 if (sd->remote) _elm_url_cancel(sd->remote);
556 free(sd->remote_data); 565 free(sd->remote_data);
557 eina_stringshare_del(sd->key); 566 eina_stringshare_del(sd->key);
@@ -602,7 +611,7 @@ _efl_ui_image_show(Eo *obj, Efl_Ui_Image_Data *sd)
602 611
603 if (sd->preload_status == EFL_UI_IMAGE_PRELOADING) return; 612 if (sd->preload_status == EFL_UI_IMAGE_PRELOADING) return;
604 efl_gfx_visible_set(sd->img, EINA_TRUE); 613 efl_gfx_visible_set(sd->img, EINA_TRUE);
605 ELM_SAFE_FREE(sd->prev_img, evas_object_del); 614 _prev_img_del(sd);
606} 615}
607 616
608static void 617static void
@@ -611,7 +620,7 @@ _efl_ui_image_hide(Eo *obj, Efl_Ui_Image_Data *sd)
611 sd->show = EINA_FALSE; 620 sd->show = EINA_FALSE;
612 efl_gfx_visible_set(efl_super(obj, MY_CLASS), EINA_FALSE); 621 efl_gfx_visible_set(efl_super(obj, MY_CLASS), EINA_FALSE);
613 efl_gfx_visible_set(sd->img, EINA_FALSE); 622 efl_gfx_visible_set(sd->img, EINA_FALSE);
614 ELM_SAFE_FREE(sd->prev_img, evas_object_del); 623 _prev_img_del(sd);
615} 624}
616 625
617EOLIAN static void 626EOLIAN static void
@@ -1745,7 +1754,7 @@ elm_image_preload_disabled_set(Evas_Object *obj, Eina_Bool disable)
1745 { 1754 {
1746 evas_object_image_preload(sd->img, disable); 1755 evas_object_image_preload(sd->img, disable);
1747 if (sd->show) evas_object_show(sd->img); 1756 if (sd->show) evas_object_show(sd->img);
1748 ELM_SAFE_FREE(sd->prev_img, evas_object_del); 1757 _prev_img_del(sd);
1749 } 1758 }
1750 sd->preload_status = EFL_UI_IMAGE_PRELOAD_DISABLED; 1759 sd->preload_status = EFL_UI_IMAGE_PRELOAD_DISABLED;
1751 } 1760 }