edje: properly destroy color_class and text_class on an Edje_Object.

SVN revision: 75647
This commit is contained in:
Cedric BAIL 2012-08-24 09:22:21 +00:00
parent 25feacc120
commit c5fe5abff2
3 changed files with 29 additions and 18 deletions

View File

@ -560,3 +560,8 @@
2012-08-21 Guilherme Silveira
* Fix password timeout with fixed point.
2012-08-24 Cedric Bail
* Properly destroy color_class and text_class on an Edje_Object.

View File

@ -32,6 +32,7 @@ Fixes:
* Reduce potential reentrant issue when using edje_object_signal_emit.
* Call edje_object_message_signal_process also on GROUP part Edje object.
* Remove memory leak when alias are present in the edj file.
* Properly destroy color_class and text_class on an Edje_Object.
Edje 1.2.0

View File

@ -188,16 +188,29 @@ edje_shutdown(void)
}
/* Private Routines */
static Eina_Bool
_class_member_free(const Eina_Hash *hash __UNUSED__,
const void *key,
void *data,
void *fdata)
static void
_class_member_free(Eina_Hash *hash,
void (*_edje_class_member_direct_del)(const char *class, void *l))
{
void (*_edje_class_member_direct_del)(const char *class, void *l) = fdata;
const char *color_class;
Eina_Iterator *it;
Eina_List *class_kill = NULL;
_edje_class_member_direct_del(key, data);
return EINA_TRUE;
if (hash)
{
it = eina_hash_iterator_key_new(hash);
EINA_ITERATOR_FOREACH(it, color_class)
class_kill = eina_list_append(class_kill, color_class);
eina_iterator_free(it);
EINA_LIST_FREE(class_kill, color_class)
{
void *l;
l = eina_hash_find(hash, color_class);
_edje_class_member_direct_del(color_class, l);
}
eina_hash_free(hash);
}
}
void
@ -254,16 +267,8 @@ _edje_del(Edje *ed)
free(cb);
}
if (ed->members.text_class)
{
eina_hash_foreach(ed->members.text_class, _class_member_free, _edje_text_class_member_direct_del);
eina_hash_free(ed->members.text_class);
}
if (ed->members.color_class)
{
eina_hash_foreach(ed->members.color_class, _class_member_free, _edje_color_class_member_direct_del);
eina_hash_free(ed->members.color_class);
}
_class_member_free(ed->members.text_class, _edje_text_class_member_direct_del);
_class_member_free(ed->members.color_class, _edje_color_class_member_direct_del);
free(ed);
}