efl/evas: use inheritance instead of strcmp and work around code running between...
authorCedric BAIL <cedric.bail@free.fr>
Sun, 27 Jan 2013 08:34:22 +0000 (08:34 +0000)
committerCedric BAIL <cedric.bail@free.fr>
Sun, 27 Jan 2013 08:34:22 +0000 (08:34 +0000)
SVN revision: 83367

src/lib/evas/canvas/evas_object_image.c
src/lib/evas/canvas/evas_object_main.c

index 3254303..25605c4 100644 (file)
@@ -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());
 }
 
index 2b780ce..373ae61 100644 (file)
@@ -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);