forked from enlightenment/efl
Revert "Eo: Move eo_add_ref logic inside the library."
This reverts commit 8d16d8eb57
.
this broke child object deletion in all the cases that I tested and regular object deletion in some cases as well
This commit is contained in:
parent
83d57bc6f8
commit
11da942184
|
@ -636,7 +636,7 @@ EAPI void eo_error_set_internal(const Eo *obj, const char *file, int line);
|
|||
#define eo_add(klass, parent, ...) \
|
||||
({ \
|
||||
const Eo_Class *_tmp_klass = klass; \
|
||||
Eo *_tmp_obj = _eo_add_internal_start(__FILE__, __LINE__, _tmp_klass, parent, EINA_FALSE); \
|
||||
Eo *_tmp_obj = _eo_add_internal_start(__FILE__, __LINE__, _tmp_klass, parent); \
|
||||
eo_do(_tmp_obj, \
|
||||
eo_constructor(); \
|
||||
__VA_ARGS__; \
|
||||
|
@ -659,17 +659,12 @@ EAPI void eo_error_set_internal(const Eo *obj, const char *file, int line);
|
|||
*/
|
||||
#define eo_add_ref(klass, parent, ...) \
|
||||
({ \
|
||||
const Eo_Class *_tmp_klass = klass; \
|
||||
Eo *_tmp_obj = _eo_add_internal_start(__FILE__, __LINE__, _tmp_klass, parent, EINA_TRUE); \
|
||||
eo_do(_tmp_obj, \
|
||||
eo_constructor(); \
|
||||
__VA_ARGS__; \
|
||||
_tmp_obj = eo_finalize(); \
|
||||
); \
|
||||
_tmp_obj; \
|
||||
Eo *_tmp_obj_ref = eo_add(klass, parent, __VA_ARGS__); \
|
||||
if (eo_do(_tmp_obj_ref, eo_parent_get())) eo_ref(_tmp_obj_ref); \
|
||||
_tmp_obj_ref; \
|
||||
})
|
||||
|
||||
EAPI Eo * _eo_add_internal_start(const char *file, int line, const Eo_Class *klass_id, Eo *parent, Eina_Bool ref);
|
||||
EAPI Eo * _eo_add_internal_start(const char *file, int line, const Eo_Class *klass_id, Eo *parent);
|
||||
|
||||
/**
|
||||
* @brief Get a pointer to the data of an object for a specific class.
|
||||
|
|
|
@ -868,7 +868,7 @@ _eo_class_funcs_set(_Eo_Class *klass)
|
|||
}
|
||||
|
||||
EAPI Eo *
|
||||
_eo_add_internal_start(const char *file, int line, const Eo_Class *klass_id, Eo *parent_id, Eina_Bool ref)
|
||||
_eo_add_internal_start(const char *file, int line, const Eo_Class *klass_id, Eo *parent_id)
|
||||
{
|
||||
_Eo_Object *obj;
|
||||
|
||||
|
@ -915,7 +915,7 @@ _eo_add_internal_start(const char *file, int line, const Eo_Class *klass_id, Eo
|
|||
|
||||
/* If there's a parent. Unref. Eo_add should return an object with either a
|
||||
* parent ref, or with the lack of, just a ref. */
|
||||
if (!ref && eo_do(eo_id, eo_parent_get()))
|
||||
if (eo_do(eo_id, eo_parent_get()))
|
||||
{
|
||||
_eo_unref(obj);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue