From c5af1a7305df0878ae754f156dfb8b8686aa6a9b Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 26 Nov 2013 10:10:24 +0000 Subject: [PATCH] Eo: Add an error message when old parent is wrong. This is an addition to raster's fix in 55d8156414012e718a7e7adb3f9cd33e19744dc1 (eo - base class protection against NULL old_parent_pd) --- src/lib/eo/eo_base_class.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c index 8d137e1..c83b19b 100644 --- a/src/lib/eo/eo_base_class.c +++ b/src/lib/eo/eo_base_class.c @@ -132,8 +132,16 @@ _parent_set(Eo *obj, void *class_data, va_list *list) old_parent_pd = eo_data_scope_get(pd->parent, EO_BASE_CLASS); if (old_parent_pd) - old_parent_pd->children = eina_list_remove(old_parent_pd->children, - obj); + { + old_parent_pd->children = eina_list_remove(old_parent_pd->children, + obj); + } + else + { + ERR("CONTACT DEVS!!! SHOULD NEVER HAPPEN!!! Old parent %p for object %p is not a valid Eo object.", + pd->parent, obj); + } + eo_xunref(obj, pd->parent); } -- 2.7.4