aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/evas/src/lib/canvas/evas_main.c
diff options
context:
space:
mode:
authorChidambar 'ilLogict' Zinnoury <illogict@online.fr>2010-09-26 02:27:01 +0000
committerCarsten Haitzler <raster@rasterman.com>2010-09-26 02:27:01 +0000
commit15dd911de30d34926d36c97d9e5799259068c671 (patch)
treefe62a6d4d447bf6fdef7d6d152356b7bf043b639 /legacy/evas/src/lib/canvas/evas_main.c
parentformatting. (diff)
downloadefl-15dd911de30d34926d36c97d9e5799259068c671.tar.gz
From: Chidambar 'ilLogict' Zinnoury <illogict@online.fr>
Subject: [E-devel] [tentative patch] evas memleak when no callbacks I'm seeing some memleaks while using Evas' buffer engine. After investigation, it seems that evas_free does nothing and returns immediately if the canvas has no callbacks, which is what happens with the buffer engine. The attached patch seems to do the trick. However, as I don't know that much Evas' internals, I thought it'd be better to ask whether it's correct or I'm mistaken before committing. So please comment. SVN revision: 52769
Diffstat (limited to 'legacy/evas/src/lib/canvas/evas_main.c')
-rw-r--r--legacy/evas/src/lib/canvas/evas_main.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/legacy/evas/src/lib/canvas/evas_main.c b/legacy/evas/src/lib/canvas/evas_main.c
index 5579ed4bfc..c58700a854 100644
--- a/legacy/evas/src/lib/canvas/evas_main.c
+++ b/legacy/evas/src/lib/canvas/evas_main.c
@@ -202,19 +202,22 @@ evas_free(Evas *e)
if (e->walking_list == 0) evas_render_idle_flush(e);
if (e->walking_list > 0) return;
- if (!e->callbacks) return;
- if (e->callbacks->deletions_waiting) return;
-
- e->callbacks->deletions_waiting = 0;
- evas_event_callback_list_post_free(&e->callbacks->callbacks);
- if (!e->callbacks->callbacks)
+
+ if (e->callbacks)
{
- free(e->callbacks);
- e->callbacks = NULL;
+ if (e->callbacks->deletions_waiting) return;
+
+ e->callbacks->deletions_waiting = 0;
+ evas_event_callback_list_post_free(&e->callbacks->callbacks);
+ if (!e->callbacks->callbacks)
+ {
+ free(e->callbacks);
+ e->callbacks = NULL;
+ }
+
+ _evas_post_event_callback_free(e);
}
- _evas_post_event_callback_free(e);
-
del = 1;
e->walking_list++;
e->cleanup = 1;