jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=7e785d936db96b6c6ff572add0c5eacc1066dd7a

commit 7e785d936db96b6c6ff572add0c5eacc1066dd7a
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Fri Nov 24 16:15:03 2017 +0900

    eo: Make sure auto_unref only applies after finalize
    
    It would be pretty stupid to create an object that dies before it even
    gets created. Auto-unref is for parts and should probably not be used
    anywhere else :)
---
 src/lib/eo/eo.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 17595e055e..8365807e4e 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -621,7 +621,7 @@ err:
      {
         if (EINA_UNLIKELY(obj->auto_unref != 0))
           {
-             if (!(--obj->auto_unref))
+             if (obj->finalized && !(--obj->auto_unref))
                efl_unref(eo_id);
           }
         _efl_unref(obj);
@@ -680,7 +680,7 @@ _efl_object_call_end(Efl_Object_Op_Call_Data *call)
      {
         if (EINA_UNLIKELY(call->obj->auto_unref != 0))
           {
-             if (!(--call->obj->auto_unref))
+             if (call->obj->finalized && !(--call->obj->auto_unref))
                efl_unref(call->eo_id);
           }
         _efl_unref(call->obj);
@@ -750,7 +750,7 @@ _efl_object_op_api_id_get(const void *api_func, const Eo 
*eo_obj, const char *ap
                        "Unable to resolve op for api func %p for obj=%p (%s)", 
api_func, eo_obj, efl_class_name_get(eo_obj));
         if (EINA_UNLIKELY(obj->auto_unref))
           {
-             if (!(--obj->auto_unref))
+             if (obj->finalized && !(--obj->auto_unref))
                efl_unref(eo_obj);
           }
         return EFL_NOOP;

-- 


Reply via email to