cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=6e0c86eb67c5a95953e0dcedb01ecc6e9cfa391e

commit 6e0c86eb67c5a95953e0dcedb01ecc6e9cfa391e
Author: Cedric Bail <ced...@osg.samsung.com>
Date:   Fri Apr 6 11:28:55 2018 -0700

    evas: when passed an Evas_Object, we should try to access it directly so 
that during destructor Evas is still accessible.
---
 src/lib/evas/canvas/evas_object_main.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/lib/evas/canvas/evas_object_main.c 
b/src/lib/evas/canvas/evas_object_main.c
index 49d0586c8e..a06397003a 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -2634,6 +2634,13 @@ evas_object_size_hint_align_get(const Evas_Object *obj, 
double *x, double *y)
 EAPI Evas *
 evas_object_evas_get(const Eo *eo_obj)
 {
+   if (efl_isa(eo_obj, EFL_CANVAS_OBJECT_CLASS))
+     {
+        Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj, NULL);
+
+        if (!obj->layer || !obj->layer->evas) return NULL;
+        return obj->layer->evas->evas;
+     }
    return efl_provider_find((Eo *) eo_obj, EVAS_CANVAS_CLASS);
 }
 

-- 


Reply via email to