raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9f690ba390fe0922df10cdefe07db8680d5a088f

commit 9f690ba390fe0922df10cdefe07db8680d5a088f
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Mon Oct 28 10:26:32 2013 +0900

    evas - cover corner case for native surface shared refs on obj delete
---
 src/lib/evas/canvas/evas_object_image.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/lib/evas/canvas/evas_object_image.c 
b/src/lib/evas/canvas/evas_object_image.c
index 5b2ef93..5178e1b 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -2625,12 +2625,23 @@ _image_video_surface_caps_get(Eo *eo_obj EINA_UNUSED, 
void *_pd, va_list *list)
    *caps = (!o->video_surface ? 0 : o->pixels->video_caps);
 }
 
+static void
+_on_image_native_surface_del(void *data EINA_UNUSED, Evas *e EINA_UNUSED, 
Evas_Object *obj, void *einfo EINA_UNUSED)
+{
+   evas_object_image_native_surface_set(obj, NULL);
+}
+
 EAPI void
 evas_object_image_native_surface_set(Evas_Object *eo_obj, Evas_Native_Surface 
*surf)
 {
    MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
    return;
    MAGIC_CHECK_END();
+   evas_object_event_callback_del_full
+     (eo_obj, EVAS_CALLBACK_DEL, _on_image_native_surface_del, NULL);
+   if (surf) // We need to unset native surf on del to remove shared hash refs
+     evas_object_event_callback_add
+     (eo_obj, EVAS_CALLBACK_DEL, _on_image_native_surface_del, NULL);
    eo_do(eo_obj, evas_obj_image_native_surface_set(surf));
 }
 

-- 


Reply via email to