summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-04-13 19:59:00 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-04-13 20:02:12 +0900
commitc2e26a51215d379a6926b0ca44f3d4d664d84bb4 (patch)
treecd9786c9f39f3cdd0781ce7e84924ae04c95feda
parentbc9bde253a3d4ef09c8ea4451aec8b1425fc83c8 (diff)
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
-rw-r--r--src/lib/edje/edje_main.c5
-rw-r--r--src/lib/edje/edje_signal.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/edje/edje_main.c b/src/lib/edje/edje_main.c
index 8748a35339..f46be4802d 100644
--- a/src/lib/edje/edje_main.c
+++ b/src/lib/edje/edje_main.c
@@ -251,15 +251,20 @@ _edje_del(Edje *ed)
251 } 251 }
252 _edje_message_del(ed); 252 _edje_message_del(ed);
253 _edje_signal_callback_free(ed->callbacks); 253 _edje_signal_callback_free(ed->callbacks);
254 ed->callbacks = NULL;
254 _edje_file_del(ed); 255 _edje_file_del(ed);
255 if (ed->path) eina_stringshare_del(ed->path); 256 if (ed->path) eina_stringshare_del(ed->path);
256 if (ed->group) eina_stringshare_del(ed->group); 257 if (ed->group) eina_stringshare_del(ed->group);
257 if (ed->parent) eina_stringshare_del(ed->parent); 258 if (ed->parent) eina_stringshare_del(ed->parent);
258 ed->path = NULL; 259 ed->path = NULL;
259 ed->group = NULL; 260 ed->group = NULL;
261 ed->parent = NULL;
260 eina_hash_free(ed->color_classes); 262 eina_hash_free(ed->color_classes);
261 eina_hash_free(ed->text_classes); 263 eina_hash_free(ed->text_classes);
262 eina_hash_free(ed->size_classes); 264 eina_hash_free(ed->size_classes);
265 ed->color_classes = NULL;
266 ed->text_classes = NULL;
267 ed->size_classes = NULL;
263 EINA_LIST_FREE(ed->text_insert_filter_callbacks, cb) 268 EINA_LIST_FREE(ed->text_insert_filter_callbacks, cb)
264 { 269 {
265 eina_stringshare_del(cb->part); 270 eina_stringshare_del(cb->part);
diff --git a/src/lib/edje/edje_signal.c b/src/lib/edje/edje_signal.c
index de93990c99..88c0f1d2fe 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)
294 _edje_signal_callback_matches_unref((Edje_Signal_Callback_Matches *)gp->matches); 294 _edje_signal_callback_matches_unref((Edje_Signal_Callback_Matches *)gp->matches);
295 gp->matches = NULL; 295 gp->matches = NULL;
296 free(gp->flags); 296 free(gp->flags);
297 gp->flags = NULL;
297 free(gp->custom_data); 298 free(gp->custom_data);
299 gp->custom_data = NULL;
298 free(gp); 300 free(gp);
299} 301}
300 302