i think this will fix the layer thing nathan found

SVN revision: 18380
This commit is contained in:
Carsten Haitzler 2005-11-08 11:59:21 +00:00
parent 081335eda4
commit 69cc1760ef
3 changed files with 6 additions and 1 deletions

View File

@ -15,6 +15,7 @@ evas_object_inject(Evas_Object *obj, Evas *e)
evas_layer_add(lay);
}
lay->objects = evas_object_list_append(lay->objects, obj);
lay->usage++;
obj->layer = lay;
obj->in_layer = 1;
}
@ -24,9 +25,10 @@ evas_object_release(Evas_Object *obj, int clean_layer)
{
if (!obj->in_layer) return;
obj->layer->objects = evas_object_list_remove(obj->layer->objects, obj);
obj->layer->usage--;
if (clean_layer)
{
if (!obj->layer->objects)
if (obj->layer->usage <= 0)
{
evas_layer_del(obj->layer);
evas_layer_free(obj->layer);

View File

@ -139,6 +139,7 @@ evas_object_smart_member_add(Evas_Object *obj, Evas_Object *smart_obj)
evas_object_release(obj, 1);
obj->layer = smart_obj->layer;
obj->cur.layer = obj->layer->layer;
obj->layer->usage++;
obj->smart.parent = smart_obj;
smart_obj->smart.contained = evas_object_list_append(smart_obj->smart.contained, obj);
evas_object_smart_member_cache_invalidate(obj);
@ -163,6 +164,7 @@ evas_object_smart_member_del(Evas_Object *obj)
obj->smart.parent->smart.contained = evas_object_list_remove(obj->smart.parent->smart.contained, obj);
obj->smart.parent = NULL;
evas_object_smart_member_cache_invalidate(obj);
obj->layer->usage--;
obj->cur.layer = obj->layer->layer;
evas_object_inject(obj, obj->layer->evas);
obj->restack = 1;

View File

@ -286,6 +286,7 @@ struct _Evas_Layer
Evas *evas;
void *engine_data;
int usage;
unsigned char delete_me : 1;
};