tasn pushed a commit to branch master.


commit d6b18c1e25152ddce179b382fa809c2440eb864a
Author: Tom Hacohen <t...@stosb.com>
Date:   Wed Aug 26 14:17:26 2015 +0100

    Eo base: print an error when an object with a parent is destructed.
    This should not happen. Objects with parents must have their parents
    unset before they reach refcount == 0. That's because the parent is the
    one holding the refcount. This means that if we get to the destructor
    (object is deleted) while a parent is still set, we have an error
 src/lib/eo/eo_base_class.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index bbdf426..77a4bf1 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -993,9 +993,7 @@ _eo_base_destructor(Eo *obj, Eo_Base_Data *pd)
    if (pd->parent)
-        /* If we have a parent still at the time of destruction, it means that
-         * ref was already (arguably erroneously unrefed) so we need to ref
-         * before it gets unrefed again. */
+        ERR("Object '%p' still has a parent at the time of destruction.", obj);
         eo_do(obj, eo_parent_set(NULL));


Reply via email to