fix crash when trying to get an object below the current object and a layer with no objects is present

probably a layer not being cleaned somewhere, but I can't deal with the crashing
This commit is contained in:
Mike Blumenkrantz 2013-07-11 11:39:46 +01:00
parent c4c99af1f4
commit 7dfd4581b4
1 changed files with 5 additions and 5 deletions

View File

@ -26,12 +26,12 @@ evas_object_below_get_internal(const Evas_Object_Protected_Data *obj)
return (Evas_Object_Protected_Data *)((EINA_INLIST_GET(obj))->prev);
else
{
if ((EINA_INLIST_GET(obj->layer))->prev)
{
Evas_Layer *l;
Evas_Layer *l = (Evas_Layer *)(EINA_INLIST_GET(obj->layer))->prev;
l = (Evas_Layer *)((EINA_INLIST_GET(obj->layer))->prev);
return (Evas_Object_Protected_Data *)((EINA_INLIST_GET((l->objects)))->last);
for (; l; l = (Evas_Layer *)(EINA_INLIST_GET(l))->prev)
{
if (l->objects)
return (Evas_Object_Protected_Data *)((EINA_INLIST_GET((l->objects)))->last);
}
}
return NULL;