tasn pushed a commit to branch master.

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

commit f122437dd6fe624e8c3932e39005cd2c172d8162
Author: Tom Hacohen <t...@stosb.com>
Date:   Sun Jun 5 15:16:58 2016 +0100

    Eo: fix reference hack when calling composite objects.
    
    We used to keep a reference to the parent object and have it in the call
    structure although we were actually calling the function on the embedded
    object. This was needed because we wanted to unref the parent correctly.
    This was incorrect (and marked as a hack) and now I finally gotten
    around to implementing the (amazingly simple) fix to remove this
    workaround.
    
    Essentially we just ref the comp object, unref the parent, and let the
    normal eo call flow to unref the comp object correctly later on, like it
    would have unreffed the extra ref we had for the parent.
---
 src/lib/eo/eo.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 2797d1a..6489d47 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -437,10 +437,13 @@ end:
              if (EINA_LIKELY(func->func && func->src))
                {
                   call->eo_id = _eo_obj_id_get(emb_obj);
-                  call->obj = obj; /* FIXME-eo4: Hack, we retain the previous 
object so we unref it... */
+                  call->obj = _eo_ref(emb_obj);
                   call->func = func->func;
                   call->data = _eo_data_scope_get(emb_obj, func->src);
 
+                  /* We reffed it above, but no longer need/use it. */
+                  _eo_unref(obj);
+
                   return EINA_TRUE;
                }
           }

-- 


Reply via email to