From ac693620accd174942591e4940c2a65dc90692af Mon Sep 17 00:00:00 2001 From: hermet Date: Fri, 10 Feb 2012 12:29:04 +0000 Subject: [PATCH] elementary/widget - fixed to prevent infinite loop. Now, if user passes the parent object of obj as the sub object, then it reverses the obj - subobj relationship. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@67823 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/elm_widget.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c index 2e961d3..7357235 100644 --- a/src/lib/elm_widget.c +++ b/src/lib/elm_widget.c @@ -920,6 +920,12 @@ elm_widget_sub_object_add(Evas_Object *obj, Elm_Theme *th, *pth = elm_widget_theme_get(sobj); Eina_Bool mirrored, pmirrored = elm_widget_mirrored_get(obj); + if (sobj == sd->parent_obj) + { + elm_widget_sub_object_del(sobj, obj); + WRN("You passed a parent object of obj = %p as the sub object = %p!", obj, sobj); + } + if (_elm_widget_is(sobj)) { Smart_Data *sd2 = evas_object_smart_data_get(sobj); -- 2.7.4