summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-08-24 09:22:21 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-08-24 09:22:21 +0000
commitc5fe5abff2f5fed4910cc7836066b3c93f899256 (patch)
tree6efcd95c5282002df19f3efcd4daaf5dcde59ec5 /legacy
parent25feacc120fb6029fece09f688fd82ab6fb5564f (diff)
edje: properly destroy color_class and text_class on an Edje_Object.
SVN revision: 75647
Diffstat (limited to 'legacy')
-rw-r--r--legacy/edje/ChangeLog5
-rw-r--r--legacy/edje/NEWS1
-rw-r--r--legacy/edje/src/lib/edje_main.c41
3 files changed, 29 insertions, 18 deletions
diff --git a/legacy/edje/ChangeLog b/legacy/edje/ChangeLog
index ee7b62cd66..24e9617696 100644
--- a/legacy/edje/ChangeLog
+++ b/legacy/edje/ChangeLog
@@ -560,3 +560,8 @@
5602012-08-21 Guilherme Silveira 5602012-08-21 Guilherme Silveira
561 561
562 * Fix password timeout with fixed point. 562 * Fix password timeout with fixed point.
563
5642012-08-24 Cedric Bail
565
566 * Properly destroy color_class and text_class on an Edje_Object.
567
diff --git a/legacy/edje/NEWS b/legacy/edje/NEWS
index 547ca1bd2e..dddf53d024 100644
--- a/legacy/edje/NEWS
+++ b/legacy/edje/NEWS
@@ -32,6 +32,7 @@ Fixes:
32 * Reduce potential reentrant issue when using edje_object_signal_emit. 32 * Reduce potential reentrant issue when using edje_object_signal_emit.
33 * Call edje_object_message_signal_process also on GROUP part Edje object. 33 * Call edje_object_message_signal_process also on GROUP part Edje object.
34 * Remove memory leak when alias are present in the edj file. 34 * Remove memory leak when alias are present in the edj file.
35 * Properly destroy color_class and text_class on an Edje_Object.
35 36
36Edje 1.2.0 37Edje 1.2.0
37 38
diff --git a/legacy/edje/src/lib/edje_main.c b/legacy/edje/src/lib/edje_main.c
index 01b428a147..f9b8eab2a1 100644
--- a/legacy/edje/src/lib/edje_main.c
+++ b/legacy/edje/src/lib/edje_main.c
@@ -188,16 +188,29 @@ edje_shutdown(void)
188} 188}
189 189
190/* Private Routines */ 190/* Private Routines */
191static Eina_Bool 191static void
192_class_member_free(const Eina_Hash *hash __UNUSED__, 192_class_member_free(Eina_Hash *hash,
193 const void *key, 193 void (*_edje_class_member_direct_del)(const char *class, void *l))
194 void *data,
195 void *fdata)
196{ 194{
197 void (*_edje_class_member_direct_del)(const char *class, void *l) = fdata; 195 const char *color_class;
196 Eina_Iterator *it;
197 Eina_List *class_kill = NULL;
198 198
199 _edje_class_member_direct_del(key, data); 199 if (hash)
200 return EINA_TRUE; 200 {
201 it = eina_hash_iterator_key_new(hash);
202 EINA_ITERATOR_FOREACH(it, color_class)
203 class_kill = eina_list_append(class_kill, color_class);
204 eina_iterator_free(it);
205 EINA_LIST_FREE(class_kill, color_class)
206 {
207 void *l;
208
209 l = eina_hash_find(hash, color_class);
210 _edje_class_member_direct_del(color_class, l);
211 }
212 eina_hash_free(hash);
213 }
201} 214}
202 215
203void 216void
@@ -254,16 +267,8 @@ _edje_del(Edje *ed)
254 free(cb); 267 free(cb);
255 } 268 }
256 269
257 if (ed->members.text_class) 270 _class_member_free(ed->members.text_class, _edje_text_class_member_direct_del);
258 { 271 _class_member_free(ed->members.color_class, _edje_color_class_member_direct_del);
259 eina_hash_foreach(ed->members.text_class, _class_member_free, _edje_text_class_member_direct_del);
260 eina_hash_free(ed->members.text_class);
261 }
262 if (ed->members.color_class)
263 {
264 eina_hash_foreach(ed->members.color_class, _class_member_free, _edje_color_class_member_direct_del);
265 eina_hash_free(ed->members.color_class);
266 }
267 free(ed); 272 free(ed);
268} 273}
269 274