cedric pushed a commit to branch master.

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

commit c2c416fdf77017f49aa31a9744aeda9b114e7e61
Author: Vyacheslav Reutskiy <v.reuts...@samsung.com>
Date:   Mon Nov 4 15:39:44 2013 +0900

    edje: edje_edit api - fixed seg fault in the edje_edit_part_del
    
    Reviewers: cedric, seoz
    
    Reviewed By: cedric
    
    Differential Revision: https://phab.enlightenment.org/D315
    
    Signed-off-by: Cedric Bail <cedric.b...@samsung.com>
---
 src/lib/edje/edje_edit.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index be6972d..cfd97bd 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -315,7 +315,7 @@ _edje_real_part_free(Edje *ed, Edje_Real_Part *rp)
        evas_object_del(rp->object);
      }
 
-   if (rp->typedata.swallow->swallowed_object)
+   if ((rp->typedata.swallow) && (rp->typedata.swallow->swallowed_object))
      {
        evas_object_smart_member_del(rp->typedata.swallow->swallowed_object);
        evas_object_event_callback_del(rp->typedata.swallow->swallowed_object,
@@ -333,10 +333,10 @@ _edje_real_part_free(Edje *ed, Edje_Real_Part *rp)
        rp->typedata.swallow->swallowed_object = NULL;
      }
 
-   if (rp->typedata.text->text) eina_stringshare_del(rp->typedata.text->text);
-   if (rp->typedata.text->font) eina_stringshare_del(rp->typedata.text->font);
-   if (rp->typedata.text->cache.in_str) 
eina_stringshare_del(rp->typedata.text->cache.in_str);
-   if (rp->typedata.text->cache.out_str) 
eina_stringshare_del(rp->typedata.text->cache.out_str);
+   if ((rp->typedata.text) && (rp->typedata.text->text)) 
eina_stringshare_del(rp->typedata.text->text);
+   if ((rp->typedata.text) && (rp->typedata.text->font)) 
eina_stringshare_del(rp->typedata.text->font);
+   if ((rp->typedata.text) && (rp->typedata.text->cache.in_str)) 
eina_stringshare_del(rp->typedata.text->cache.in_str);
+   if ((rp->typedata.text) && (rp->typedata.text->cache.out_str)) 
eina_stringshare_del(rp->typedata.text->cache.out_str);
 
    if (rp->custom)
      {
@@ -2092,8 +2092,10 @@ edje_edit_part_del(Evas_Object *obj, const char* part)
        if (i == id) continue; //don't check the deleted id
        real = ed->table_parts[i];
 
-       if (real->typedata.text->source == rp) real->typedata.text->source = 
NULL;
-       if (real->typedata.text->text_source == rp) 
real->typedata.text->text_source = NULL;
+       if ((real->typedata.text) && (real->typedata.text->source == rp))
+          real->typedata.text->source = NULL;
+       if ((real->typedata.text) && (real->typedata.text->text_source == rp))
+          real->typedata.text->text_source = NULL;
 
        if (real->part->clip_to_id == rp->part->id)
          {

-- 


Reply via email to