Eo add: beef up error reporting.

In some cases object ceration would fail without an error,
this is bad and should not happen.

Thanks to cedric for reporting.
This commit is contained in:
Tom Hacohen 2015-01-23 16:51:02 +00:00
parent d85d9672b5
commit 40cb2cd3d4
2 changed files with 24 additions and 5 deletions

View File

@ -933,7 +933,10 @@ _eo_add_internal_end(Eo *eo_id)
}
if (EINA_UNLIKELY(!fptr->o.obj))
return NULL;
{
ERR("Corrupt call stuck, shouldn't happen, please report!");
return NULL;
}
if (!fptr->o.obj->condtor_done || fptr->o.obj->do_error)
{

View File

@ -11,29 +11,45 @@
#define EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, ret) \
_Eo_Object *obj; \
do { \
if (!obj_id) return ret; \
obj = _eo_obj_pointer_get((Eo_Id)obj_id); \
if (!obj) return ret; \
if (!obj) { \
ERR("Obj (%p) is an invalid ref.", obj_id); \
return ret; \
} \
} while (0)
#define EO_OBJ_POINTER_RETURN(obj_id, obj) \
_Eo_Object *obj; \
do { \
if (!obj_id) return; \
obj = _eo_obj_pointer_get((Eo_Id)obj_id); \
if (!obj) return; \
if (!obj) { \
ERR("Obj (%p) is an invalid ref.", obj_id); \
return; \
} \
} while (0)
#define EO_CLASS_POINTER_RETURN_VAL(klass_id, klass, ret) \
_Eo_Class *klass; \
do { \
if (!klass_id) return ret; \
klass = _eo_class_pointer_get(klass_id); \
if (!klass) return ret; \
if (!klass) { \
ERR("Klass (%p) is an invalid ref.", klass_id); \
return ret; \
} \
} while (0)
#define EO_CLASS_POINTER_RETURN(klass_id, klass) \
_Eo_Class *klass; \
do { \
if (!klass_id) return; \
klass = _eo_class_pointer_get(klass_id); \
if (!klass) return; \
if (!klass) { \
ERR("Klass (%p) is an invalid ref.", klass_id); \
return; \
} \
} while (0)
#else