From bdc54a6afd816d8e1201eb0667005818bfa3b67b Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Tue, 17 Mar 2009 17:45:37 +0000 Subject: [PATCH] * evas_object_smart: Prevent adding a child from another Evas. **** WARNING **** E is bugged in some place, it does swallow object from another Evas in some place. With this patch, it will abort sooner. If you find situation where it abort, please report. This are nasty bug hidden in our code base. And yes, you will the white box of death, this is expected. SVN revision: 39528 --- legacy/evas/src/lib/canvas/evas_object_smart.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/legacy/evas/src/lib/canvas/evas_object_smart.c b/legacy/evas/src/lib/canvas/evas_object_smart.c index 8f4ee3faf5..28a87e30ed 100644 --- a/legacy/evas/src/lib/canvas/evas_object_smart.c +++ b/legacy/evas/src/lib/canvas/evas_object_smart.c @@ -184,10 +184,18 @@ evas_object_smart_member_add(Evas_Object *obj, Evas_Object *smart_obj) abort(); return; } + if (obj->layer && smart_obj->layer + && obj->layer->evas == smart_obj->layer->evas) + { + printf("EVAS ERROR: Adding object %p from Evas (%p) from another Evas (%p)\n", obj, obj->layer->evas, smart_obj->layer->evas); + abort(); + return; + } + if (obj->smart.parent == smart_obj) return; if (obj->smart.parent) evas_object_smart_member_del(obj); - + evas_object_release(obj, 1); obj->layer = smart_obj->layer; obj->cur.layer = obj->layer->layer;