* evas_object_smart: Prevent adding a child from another Evas.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 17 Mar 2009 17:45:37 +0000 (17:45 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 17 Mar 2009 17:45:37 +0000 (17:45 +0000)
**** 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.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@39528 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_smart.c

index 8f4ee3f..28a87e3 100644 (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;