* 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
This commit is contained in:
Cedric BAIL 2009-03-17 17:45:37 +00:00
parent 5378f8d4d6
commit bdc54a6afd
1 changed files with 9 additions and 1 deletions

View File

@ -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;