aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-03-20 13:20:26 -0400
committerCedric Bail <cedric@osg.samsung.com>2018-03-20 17:20:57 -0700
commit168849e8a08966ecc284e28f64126a3a85965965 (patch)
tree8f476ea67593a4d01a1efd22971b118d8c3e8f00
parentedje: implement invalidate method and unset device callbacks here (diff)
downloadefl-168849e8a08966ecc284e28f64126a3a85965965.tar.gz
eo: use unref instead of del when constructor fails without parent
Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
-rw-r--r--src/lib/eo/eo.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 4e6b0912e9..0fb5891d33 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -927,7 +927,8 @@ ok_nomatch:
EO_OBJ_POINTER_GOTO_PROXY(eo_id, new_obj, err_newid);
/* We have two refs at this point. */
_efl_unref(obj);
- efl_del((Eo *)obj->header.id);
+ if (parent_id) efl_del((Eo *) obj->header.id);
+ else _efl_unref(obj);
_efl_ref(new_obj);
EO_OBJ_DONE(eo_id);
}
@@ -938,7 +939,8 @@ err_noid:
file, line, klass->desc->name);
/* We have two refs at this point. */
_efl_unref(obj);
- efl_del((Eo *) obj->header.id);
+ if (parent_id) efl_del((Eo *) obj->header.id);
+ else _efl_unref(obj);
err_newid:
if (parent_id) EO_OBJ_DONE(parent_id);
return NULL;
@@ -989,7 +991,8 @@ err_condtor:
}
cleanup:
_efl_unref(obj);
- efl_del((Eo *) obj->header.id);
+ if (efl_parent_get(eo_id)) efl_del((Eo *) obj->header.id);
+ else _efl_unref(obj);
EO_OBJ_DONE(eo_id);
return NULL;
}