summaryrefslogtreecommitdiff
path: root/src/lib/eo/eo.c
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2018-06-18 14:49:43 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2018-06-18 14:55:57 -0300
commit4a60c605280db75b1fd21502e0f92dc095db3e1f (patch)
tree8188b713f248aac3768ffa95d1b8332921adf21d /src/lib/eo/eo.c
parent0d91088d0fe00ab64e1e852551e850d403e9db37 (diff)
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.
Diffstat (limited to 'src/lib/eo/eo.c')
-rw-r--r--src/lib/eo/eo.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 91e1730..2df52d3 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -927,6 +927,7 @@ ok_nomatch_back:
927ok_nomatch: 927ok_nomatch:
928 { 928 {
929 EO_OBJ_POINTER_GOTO_PROXY(eo_id, new_obj, err_newid); 929 EO_OBJ_POINTER_GOTO_PROXY(eo_id, new_obj, err_newid);
930 _efl_ref(new_obj);
930 efl_ref(eo_id); 931 efl_ref(eo_id);
931 /* We might have two refs on the old object at this point. */ 932 /* We might have two refs on the old object at this point. */
932 efl_parent_set((Eo *) obj->header.id, NULL); 933 efl_parent_set((Eo *) obj->header.id, NULL);