raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9544c874289afd6f6eba894bde3c806ca22dda7b

commit 9544c874289afd6f6eba894bde3c806ca22dda7b
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Thu Sep 3 09:41:35 2020 +0100

    edje - calc - handle swallow disappearing mid-calc due to callabcks
    
    callbacks attached to move/resize etc. can change a swallow and ..
    well.. i hit a crash where it happens. so handle this case.
    
    @fix
---
 src/lib/edje/edje_calc.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index eed9215b23..221e7b645d 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -4761,7 +4761,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int 
flags, Edje_Calc_Params *sta
      }
    if (!ed->calc_only)
      {
-        Evas_Object *mo;
+        Evas_Object *mo = NULL;
 
         /* Common move, resize and color_set for all part. */
         switch (ep->part->type)
@@ -4945,12 +4945,17 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int 
flags, Edje_Calc_Params *sta
 
                   if (ep->part->type == EDJE_PART_TYPE_GROUP)
                     vis = evas_object_visible_get(ed->obj);
-                  
efl_gfx_entity_position_set(ep->typedata.swallow->swallowed_object, 
EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y));
-                  
efl_gfx_entity_size_set(ep->typedata.swallow->swallowed_object, 
EINA_SIZE2D(pf->final.w,  pf->final.h));
-                  
efl_gfx_entity_visible_set(ep->typedata.swallow->swallowed_object, vis);
+                  if (ep->typedata.swallow)
+                    
efl_gfx_entity_position_set(ep->typedata.swallow->swallowed_object, 
EINA_POSITION2D(ed->x + pf->final.x, ed->y + pf->final.y));
+                  if (ep->typedata.swallow)
+                    
efl_gfx_entity_size_set(ep->typedata.swallow->swallowed_object, 
EINA_SIZE2D(pf->final.w,  pf->final.h));
+                  if (ep->typedata.swallow)
+                    
efl_gfx_entity_visible_set(ep->typedata.swallow->swallowed_object, vis);
                }
-             else evas_object_hide(ep->typedata.swallow->swallowed_object);
-             mo = ep->typedata.swallow->swallowed_object;
+             else if (ep->typedata.swallow)
+               evas_object_hide(ep->typedata.swallow->swallowed_object);
+             if (ep->typedata.swallow)
+               mo = ep->typedata.swallow->swallowed_object;
           }
         else mo = ep->object;
         if (ep->part->type != EDJE_PART_TYPE_SPACER)

-- 


Reply via email to