From e1a53fe1255cb1e1330411d9d6928bbd2c1110ff Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Wed, 14 Mar 2018 12:41:22 -0700 Subject: [PATCH] eo: start printing warning when instanciating object with efl_add and no parent. --- src/lib/eo/eo.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c index b9a6bcd61f..dfb23e2934 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c @@ -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);