forked from enlightenment/efl
Evas layer: Fix deletion of canvas with still-refed objects.
This fixes the infinite loop while deleting canvases with still referenced objects. The canvas should not assume it can get rid of all of the objects. Some objects might be referenced. I also added a printf to let the user know about it. This fixes T565.
This commit is contained in:
parent
bff48f92a3
commit
bb4a19b5ad
|
@ -76,12 +76,11 @@ evas_layer_pre_free(Evas_Layer *lay)
|
||||||
|
|
||||||
void
|
void
|
||||||
evas_layer_free_objects(Evas_Layer *lay)
|
evas_layer_free_objects(Evas_Layer *lay)
|
||||||
{
|
|
||||||
while (lay->objects)
|
|
||||||
{
|
{
|
||||||
Evas_Object_Protected_Data *obj;
|
Evas_Object_Protected_Data *obj;
|
||||||
|
|
||||||
obj = (Evas_Object_Protected_Data *)lay->objects;
|
EINA_INLIST_FREE(lay->objects, obj)
|
||||||
|
{
|
||||||
evas_object_free(obj->object, 0);
|
evas_object_free(obj->object, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,8 +233,11 @@ _destructor(Eo *eo_e, void *_pd, va_list *list EINA_UNUSED)
|
||||||
{
|
{
|
||||||
if (!o->delete_me)
|
if (!o->delete_me)
|
||||||
{
|
{
|
||||||
if (o->ref > 0)
|
if ((o->ref > 0) || (eo_ref_get(o->object) > 0))
|
||||||
ERR("obj(%p, %s) ref count(%d) is bigger than 0. This object couldn't be deleted", o, o->type, o->ref);
|
{
|
||||||
|
ERR("obj(%p, %s) ref count(%d) is bigger than 0. This object couldn't be deleted", o, o->type, eo_ref_get(o->object));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
del = EINA_TRUE;
|
del = EINA_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue