From 1b7ff0248ec46ffa4bca616b4f4171600a0872ff Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Thu, 2 Jun 2011 15:21:21 +0000 Subject: [PATCH] CEDIRC: SEGV CAUSING BUG. go to e17 font settings -> advanced and sewt a font for menu item.. or menu title. segv. (try it under falgrind) the members list in the hash is garbage when its trying to remove a member. double heck your changes and test :) SVN revision: 59902 --- legacy/edje/ChangeLog | 4 ---- legacy/edje/src/lib/edje_main.c | 2 -- legacy/edje/src/lib/edje_private.h | 2 -- legacy/edje/src/lib/edje_util.c | 25 ++++++++++--------------- 4 files changed, 10 insertions(+), 23 deletions(-) diff --git a/legacy/edje/ChangeLog b/legacy/edje/ChangeLog index c75af5f..deb1382 100644 --- a/legacy/edje/ChangeLog +++ b/legacy/edje/ChangeLog @@ -110,7 +110,3 @@ evas freeze and thaw calls. May help in certain pathological situations. -2011-05-27 Cedric Bail - - * Improve performance by avoiding walking eina_list for nothing - when deleting member_class. diff --git a/legacy/edje/src/lib/edje_main.c b/legacy/edje/src/lib/edje_main.c index 0b98c1a..92d255d 100644 --- a/legacy/edje/src/lib/edje_main.c +++ b/legacy/edje/src/lib/edje_main.c @@ -200,8 +200,6 @@ _edje_del(Edje *ed) eina_stringshare_del(cb->part); free(cb); } - - if (ed->members) eina_hash_free(ed->members); free(ed); } diff --git a/legacy/edje/src/lib/edje_private.h b/legacy/edje/src/lib/edje_private.h index d2503a8..2bd70e9 100644 --- a/legacy/edje/src/lib/edje_private.h +++ b/legacy/edje/src/lib/edje_private.h @@ -1004,8 +1004,6 @@ struct _Edje int table_programs_size; unsigned int table_parts_size; - Eina_Hash *members; - Edje_Perspective *persp; struct { diff --git a/legacy/edje/src/lib/edje_util.c b/legacy/edje/src/lib/edje_util.c index 8d1a392..f28afa7 100644 --- a/legacy/edje/src/lib/edje_util.c +++ b/legacy/edje/src/lib/edje_util.c @@ -3674,38 +3674,33 @@ _edje_text_class_member_add(Edje *ed, const char *text_class) /* Get members list */ members = eina_hash_find(_edje_text_class_member_hash, text_class); + /* Remove members list */ + if (members) + eina_hash_del(_edje_text_class_member_hash, text_class, members); + /* Update the member list */ members = eina_list_prepend(members, ed); - /* Don't loose track of members list */ - if (!ed->members) - ed->members = eina_hash_string_small_new(NULL); - eina_hash_set(ed->members, text_class, members); - - /* Reset the member list to the right pointer */ + /* Add the member list back */ if (!_edje_text_class_member_hash) _edje_text_class_member_hash = eina_hash_string_superfast_new(NULL); - eina_hash_set(_edje_text_class_member_hash, text_class, members); + eina_hash_add(_edje_text_class_member_hash, text_class, members); } void _edje_text_class_member_del(Edje *ed, const char *text_class) { Eina_List *members; - Eina_List *lookup; if ((!ed) || (!text_class)) return; members = eina_hash_find(_edje_text_class_member_hash, text_class); if (!members) return; - lookup = eina_hash_find(ed->members, text_class); - - if (!lookup) return ; + eina_hash_del(_edje_text_class_member_hash, text_class, members); - eina_hash_del(ed->members, text_class, lookup); - members = eina_list_remove_list(members, lookup); - - eina_hash_set(_edje_text_class_member_hash, text_class, members); + members = eina_list_remove(members, ed); + if (members) + eina_hash_add(_edje_text_class_member_hash, text_class, members); } void -- 2.7.4