eo: start printing warning when instanciating object with efl_add and no parent.
This commit is contained in:
parent
3f5ac71ad6
commit
e1a53fe125
|
@ -858,7 +858,7 @@ err_klass:
|
|||
}
|
||||
|
||||
EAPI Eo *
|
||||
_efl_add_internal_start(const char *file, int line, const Efl_Class *klass_id, Eo *parent_id, Eina_Bool ref EINA_UNUSED, Eina_Bool is_fallback)
|
||||
_efl_add_internal_start(const char *file, int line, const Efl_Class *klass_id, Eo *parent_id, Eina_Bool ref, Eina_Bool is_fallback)
|
||||
{
|
||||
const char *func_name = __FUNCTION__;
|
||||
_Eo_Object *obj;
|
||||
|
@ -868,6 +868,11 @@ _efl_add_internal_start(const char *file, int line, const Efl_Class *klass_id, E
|
|||
|
||||
EO_CLASS_POINTER_GOTO_PROXY(klass_id, klass, err_klass);
|
||||
|
||||
// Check that in the case of efl_add we do pass a parent.
|
||||
if (!ref && !parent_id)
|
||||
ERR("Creation of '%s' object at line %i in '%s' is done without parent. This should use efl_add_ref.",
|
||||
klass->desc->name, line, file);
|
||||
|
||||
if (parent_id)
|
||||
{
|
||||
EO_OBJ_POINTER_GOTO_PROXY(parent_id, parent, err_parent);
|
||||
|
|
Loading…
Reference in New Issue