raster pushed a commit to branch master.

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

commit c2e26a51215d379a6926b0ca44f3d4d664d84bb4
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Wed Apr 13 19:59:00 2016 +0900

    edje - delete obj - null out freed items in structs/data
    
    i just got a segv freeing ian invalid ptr... it SEEMS as if something
    has tried to free and edje object twice... but i can't be sure as
    valgrind can't catch this. it's a one-off, so ensure after free, we
    NULL out things we freed to avoid this.
    
    @fix
---
 src/lib/edje/edje_main.c   | 5 +++++
 src/lib/edje/edje_signal.c | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/src/lib/edje/edje_main.c b/src/lib/edje/edje_main.c
index 8748a35..f46be48 100644
--- a/src/lib/edje/edje_main.c
+++ b/src/lib/edje/edje_main.c
@@ -251,15 +251,20 @@ _edje_del(Edje *ed)
      }
    _edje_message_del(ed);
    _edje_signal_callback_free(ed->callbacks);
+   ed->callbacks = NULL;
    _edje_file_del(ed);
    if (ed->path) eina_stringshare_del(ed->path);
    if (ed->group) eina_stringshare_del(ed->group);
    if (ed->parent) eina_stringshare_del(ed->parent);
    ed->path = NULL;
    ed->group = NULL;
+   ed->parent = NULL;
    eina_hash_free(ed->color_classes);
    eina_hash_free(ed->text_classes);
    eina_hash_free(ed->size_classes);
+   ed->color_classes = NULL;
+   ed->text_classes = NULL;
+   ed->size_classes = NULL;
    EINA_LIST_FREE(ed->text_insert_filter_callbacks, cb)
      {
         eina_stringshare_del(cb->part);
diff --git a/src/lib/edje/edje_signal.c b/src/lib/edje/edje_signal.c
index de93990..88c0f1d 100644
--- a/src/lib/edje/edje_signal.c
+++ b/src/lib/edje/edje_signal.c
@@ -294,7 +294,9 @@ _edje_signal_callback_free(const Edje_Signal_Callback_Group 
*cgp)
    _edje_signal_callback_matches_unref((Edje_Signal_Callback_Matches 
*)gp->matches);
    gp->matches = NULL;
    free(gp->flags);
+   gp->flags = NULL;
    free(gp->custom_data);
+   gp->custom_data = NULL;
    free(gp);
 }
 

-- 


Reply via email to