From 00f8823b95ba47a41da9db722bb14b19ee0b36dc Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Sun, 27 Jan 2013 08:34:22 +0000 Subject: [PATCH] efl/evas: use inheritance instead of strcmp and work around code running between destructor and free. SVN revision: 83367 --- src/lib/evas/canvas/evas_object_image.c | 3 +++ src/lib/evas/canvas/evas_object_main.c | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 3254303..25605c4 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -3252,9 +3252,12 @@ _destructor(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED) Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); Evas_Object_Image *o = _pd; + evas_object_image_video_surface_set(eo_obj, NULL); evas_object_image_free(eo_obj, obj); eina_cow_free(evas_object_image_load_opts_cow, o->load_opts); + o->load_opts = &default_load_opts; eina_cow_free(evas_object_image_pixels_cow, o->pixels); + o->pixels = &default_pixels; eo_do_super(eo_obj, eo_destructor()); } diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c index 2b780ce..373ae61 100644 --- a/src/lib/evas/canvas/evas_object_main.c +++ b/src/lib/evas/canvas/evas_object_main.c @@ -137,7 +137,6 @@ evas_object_free(Evas_Object *eo_obj, int clean_layer) int was_smart_child = 0; - if (!strcmp(obj->type, "image")) evas_object_image_video_surface_set(eo_obj, NULL); evas_object_map_set(eo_obj, NULL); if (obj->map->prev.map) evas_map_free(obj->map->prev.map); if (obj->map->cache_map) evas_map_free(obj->map->cache_map); -- 2.7.4