forked from enlightenment/efl
evas image - eina file - be paranoud about double closes
tracking some seemingly not so good asan hits on the eina file where we're accessing an eina file already closed... so be extra paranoid about it and set things to null after free/close...
This commit is contained in:
parent
c56791180d
commit
21efff6d3e
|
@ -181,7 +181,11 @@ _evas_cache_image_entry_delete(Evas_Cache_Image *cache, Image_Entry *ie)
|
|||
FREESTRC(ie->cache_key);
|
||||
FREESTRC(ie->file);
|
||||
FREESTRC(ie->key);
|
||||
if (ie->f && ie->flags.given_mmap) eina_file_close(ie->f);
|
||||
if (ie->f && ie->flags.given_mmap)
|
||||
{
|
||||
eina_file_close(ie->f);
|
||||
ie->f = NULL;
|
||||
}
|
||||
ie->cache = NULL;
|
||||
if ((cache) && (cache->func.surface_delete)) cache->func.surface_delete(ie);
|
||||
|
||||
|
|
|
@ -1711,10 +1711,34 @@ evas_object_image_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
|||
Eina_Rectangle *r;
|
||||
|
||||
/* free obj */
|
||||
eina_file_close(o->cur->f);
|
||||
if (o->cur->key) eina_stringshare_del(o->cur->key);
|
||||
if (o->cur->source) _evas_image_proxy_unset(eo_obj, obj, o);
|
||||
if (o->cur->scene) _evas_image_3d_unset(eo_obj, obj, o);
|
||||
if (o->cur->key)
|
||||
{
|
||||
eina_stringshare_del(o->cur->key);
|
||||
EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write)
|
||||
state_write->key = NULL;
|
||||
EINA_COW_IMAGE_STATE_WRITE_END(o, state_write);
|
||||
}
|
||||
if (o->cur->source)
|
||||
{
|
||||
if (o->cur->source) _evas_image_proxy_unset(eo_obj, obj, o);
|
||||
EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write)
|
||||
state_write->source = NULL;
|
||||
EINA_COW_IMAGE_STATE_WRITE_END(o, state_write);
|
||||
}
|
||||
if (o->cur->scene)
|
||||
{
|
||||
if (o->cur->scene) _evas_image_3d_unset(eo_obj, obj, o);
|
||||
EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write)
|
||||
state_write->scene = NULL;
|
||||
EINA_COW_IMAGE_STATE_WRITE_END(o, state_write);
|
||||
}
|
||||
if (o->cur->f)
|
||||
{
|
||||
eina_file_close(o->cur->f);
|
||||
EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write)
|
||||
state_write->f = NULL;
|
||||
EINA_COW_IMAGE_STATE_WRITE_END(o, state_write);
|
||||
}
|
||||
if (obj->layer && obj->layer->evas)
|
||||
{
|
||||
if (o->engine_data && ENC)
|
||||
|
|
|
@ -518,7 +518,11 @@ _evas_common_rgba_image_delete(Image_Entry *ie)
|
|||
free(frame);
|
||||
}
|
||||
}
|
||||
if (ie->f && !ie->flags.given_mmap) eina_file_close(ie->f);
|
||||
if (ie->f && !ie->flags.given_mmap)
|
||||
{
|
||||
eina_file_close(ie->f);
|
||||
ie->f = NULL;
|
||||
}
|
||||
eina_freeq_ptr_add(eina_freeq_main_get(), im, free, sizeof(*im));
|
||||
}
|
||||
|
||||
|
|
|
@ -145,7 +145,7 @@ evas_image_load_file_close_dds(void *loader_data)
|
|||
{
|
||||
Evas_Loader_Internal *loader = loader_data;
|
||||
|
||||
eina_file_close(loader->f);
|
||||
if (loader->f) eina_file_close(loader->f);
|
||||
free(loader);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue