cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0413c26f82fb5a9ffcbd02158536e7c39a34d22e

commit 0413c26f82fb5a9ffcbd02158536e7c39a34d22e
Author: Andrii Kroitor <an.kroi...@samsung.com>
Date:   Tue May 10 15:44:30 2016 -0700

    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 <ced...@osg.samsung.com>
---
 src/lib/edje/edje_edit.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index bd5552a..38a26e0 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -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;

-- 


Reply via email to