edje_edit: fix edje_edit_group_copy

Summary:
Writing copy directly to file.
Old way (adding directly to collection cache) leads to possible segfaults
on edje_collection_cache_flush.

Reviewers: reutskiy.v.v, cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D3904

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
This commit is contained in:
Andrii Kroitor 2016-05-10 15:44:30 -07:00 committed by Cedric Bail
parent 557381a070
commit 0413c26f82
1 changed files with 4 additions and 1 deletions

View File

@ -1712,7 +1712,8 @@ edje_edit_group_copy(Evas_Object *obj, const char *group_name, const char *copy_
epc->id = id;
epc->part = eina_stringshare_add(copy_name);
ed->file->collection_cache = eina_list_prepend(ed->file->collection_cache, epc);
snprintf(buf, sizeof(buf), "edje/collections/%i", epc->id);
eet_data_write(eetf, _edje_edd_edje_part_collection, buf, epc, 1);
/* Copying Scripts */
snprintf(buf, sizeof(buf), "edje/scripts/embryo/compiled/%d", e->id);
@ -1743,6 +1744,8 @@ edje_edit_group_copy(Evas_Object *obj, const char *group_name, const char *copy_
free(keys);
}
_edje_edit_edje_file_save(eetf, ed->file);
_edje_collection_free(ed->file, epc, de);
eet_close(eetf);
return EINA_TRUE;