felipealmeida pushed a commit to branch master.

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

commit 4a60c605280db75b1fd21502e0f92dc095db3e1f
Author: Felipe Magno de Almeida <fel...@expertisesolutions.com.br>
Date:   Mon Jun 18 14:49:43 2018 -0300

    eo: Fix internal reference count wrongly 0 when constructor returns a 
different object
    
    The class's Eo constructor can return a different object, which makes
    the efl_add return that object instead. However, a bug was not
    initializing the internal reference count when a different object was
    returned.
---
 src/lib/eo/eo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 91e1730047..2df52d36df 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -927,6 +927,7 @@ ok_nomatch_back:
 ok_nomatch:
      {
         EO_OBJ_POINTER_GOTO_PROXY(eo_id, new_obj, err_newid);
+        _efl_ref(new_obj);
         efl_ref(eo_id);
         /* We might have two refs on the old object at this point. */
         efl_parent_set((Eo *) obj->header.id, NULL);

-- 


Reply via email to