edje_edit: image_del fixed
Summary: fixed segfault on broken refs in edje object Reviewers: cedric, seoz, raster CC: reutskiy.v.v, cedric Differential Revision: https://phab.enlightenment.org/D759 Signed-off-by: Cedric Bail <cedric.bail@free.fr>
This commit is contained in:
parent
80b1ca8e43
commit
c17d08d2ab
|
@ -5069,8 +5069,10 @@ edje_edit_image_usage_list_get(Evas_Object *obj, const char *name, Eina_Bool fir
|
|||
|
||||
EINA_ITERATOR_FOREACH(it, pce)
|
||||
{
|
||||
if (!pce->ref) continue;
|
||||
for (i = 0; i < pce->ref->parts_count; i++)
|
||||
{
|
||||
if (!pce->ref->parts) continue;
|
||||
part = pce->ref->parts[i];
|
||||
if (part->type == EDJE_PART_TYPE_IMAGE)
|
||||
{
|
||||
|
@ -5175,16 +5177,6 @@ edje_edit_image_del(Evas_Object *obj, const char* name)
|
|||
eet_delete(eetf, last_entry);
|
||||
eet_write(eetf, entry, data, size, 0);
|
||||
}
|
||||
/* write the edje_file */
|
||||
if (!_edje_edit_edje_file_save(eetf, ed->file))
|
||||
{
|
||||
eet_close(eetf);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
eet_close(eetf);
|
||||
}
|
||||
|
||||
|
||||
_edje_if_string_free(ed, de->entry);
|
||||
--ed->file->image_dir->entries_count;
|
||||
|
@ -5198,8 +5190,10 @@ edje_edit_image_del(Evas_Object *obj, const char* name)
|
|||
it = eina_hash_iterator_data_new(ed->file->collection);
|
||||
EINA_ITERATOR_FOREACH(it, pce)
|
||||
{
|
||||
if (!pce->ref) continue;
|
||||
for (i = 0; i < pce->ref->parts_count; i++)
|
||||
{
|
||||
if (!pce->ref->parts) continue;
|
||||
part = pce->ref->parts[i];
|
||||
if (part->type == EDJE_PART_TYPE_IMAGE)
|
||||
{
|
||||
|
@ -5227,6 +5221,15 @@ edje_edit_image_del(Evas_Object *obj, const char* name)
|
|||
ed->file->image_dir->entries = realloc(ed->file->image_dir->entries,
|
||||
sizeof(Edje_Image_Directory_Entry) *
|
||||
ed->file->image_dir->entries_count);
|
||||
/* write the edje_file */
|
||||
if (!_edje_edit_edje_file_save(eetf, ed->file))
|
||||
{
|
||||
eet_close(eetf);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
eet_close(eetf);
|
||||
}
|
||||
_edje_edit_flag_script_dirty(eed, EINA_TRUE);
|
||||
|
||||
return EINA_TRUE;
|
||||
|
|
Loading…
Reference in New Issue