discomfitor pushed a commit to branch efl-1.16.

http://git.enlightenment.org/core/efl.git/commit/?id=6eeede86cb59636f20f2d8505dc3e29c886b3862

commit 6eeede86cb59636f20f2d8505dc3e29c886b3862
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Wed Dec 16 15:53:50 2015 -0500

    edje_cc: redo part type setting to be even more correct
    
    when changing the type of a part which already has descriptions, it's
    necessary to avoid copying any of the previous type-specific desc data
    
    this should be the last of them...
    
    @fix
---
 src/bin/edje/edje_cc_handlers.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index dd48163..d626af3 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -4898,23 +4898,30 @@ _part_type_set(unsigned int type)
    /* handle type change of inherited part */
    if (type != current_part->type)
      {
-        Edje_Part_Description_Common *new, *previous;
+        Edje_Part_Description_Common *new, *previous, *cur;
         Edje_Part_Collection *pc;
-        Edje_Part *ep;
+        Edje_Part *ep, *dummy;
         unsigned int i;
 
         /* we don't free old part as we don't remove all reference to them */
         part_description_image_cleanup(current_part);
+        current_part->type = type;
 
         pc = eina_list_data_get(eina_list_last(edje_collections));
         ep = current_part;
 
         previous = ep->default_desc;
+        cur = current_desc;
+        dummy = mem_alloc(SZ(Edje_Part));
+        /* ensure type is incompatible with new type */
+        dummy->type = ep->type + 2;
         if (previous)
           {
              new = _edje_part_description_alloc(type, pc->part, ep->name);
              eina_hash_add(desc_hash, &new, ep);
+             eina_hash_set(desc_hash, &previous, dummy);
              parent_desc = previous;
+             current_desc = new;
              new->state.name = strdup(previous->state.name);
              new->state.value = previous->state.value;
              st_collections_group_parts_part_description_inherit();
@@ -4929,7 +4936,9 @@ _part_type_set(unsigned int type)
              previous = ep->other.desc[i];
              new = _edje_part_description_alloc(type, pc->part, ep->name);
              eina_hash_add(desc_hash, &new, ep);
+             eina_hash_set(desc_hash, &previous, dummy);
              parent_desc = previous;
+             current_desc = new;
              new->state.name = strdup(previous->state.name);
              new->state.value = previous->state.value;
              st_collections_group_parts_part_description_inherit();
@@ -4937,9 +4946,9 @@ _part_type_set(unsigned int type)
              _part_desc_free(pc, ep, previous);
              ep->other.desc[i] = new;
           }
+        free(dummy);
+        current_desc = cur;
      }
-
-   current_part->type = type;
 }
 
 static void

-- 


Reply via email to