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);
}
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;
}
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;
}