#include "evas_common.h"
#include "evas_private.h"
+static Evas_Object_List* get_layer_objects_last( Evas_Layer* l )
+{
+ if( !l || !l->objects )
+ return NULL;
+
+ return ((Evas_Object_List *)(l->objects))->last;
+}
+
/* evas internal stuff */
Evas_Object *
evas_object_new(void)
Evas_Layer *lay;
lay = (Evas_Layer *)l;
- for (l2 = ((Evas_Object_List *)(lay->objects))->last; l2; l2 = l2->prev)
+ for (l2 = get_layer_objects_last(lay); l2; l2 = l2->prev)
{
Evas_Object *obj;
Evas_Layer *lay;
lay = (Evas_Layer *)l;
- for (l2 = ((Evas_Object_List *)(lay->objects))->last; l2; l2 = l2->prev)
+ for (l2 = get_layer_objects_last(lay); l2; l2 = l2->prev)
{
Evas_Object *obj;
Evas_Layer *lay;
lay = (Evas_Layer *)l;
- for (l2 = ((Evas_Object_List *)(lay->objects))->last; l2; l2 = l2->prev)
+ for (l2 = get_layer_objects_last(lay); l2; l2 = l2->prev)
{
Evas_Object *obj;
Evas_Layer *lay;
lay = (Evas_Layer *)l;
- for (l2 = ((Evas_Object_List *)(lay->objects))->last; l2; l2 = l2->prev)
+ for (l2 = get_layer_objects_last(lay); l2; l2 = l2->prev)
{
Evas_Object *obj;