summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/canvas/evas_layer.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2009-06-20 07:17:40 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2009-06-20 07:17:40 +0000
commit1c0ca5dfbb10fa0bb822f2d40b58664a30873181 (patch)
tree71c472c21a781f3134858e7e7bc86c0ee6bf80ec /legacy/evas/src/lib/canvas/evas_layer.c
parent324fd7b2cac0e9fb33db5e96bb5a3ba6993df051 (diff)
fix memory leak introduced with recent layer destruction.
also rename evas_layer_free() to evas_layer_free_objects() as what it do now, make _evas_layer_free() as static and use it both cases. SVN revision: 41123
Diffstat (limited to 'legacy/evas/src/lib/canvas/evas_layer.c')
-rw-r--r--legacy/evas/src/lib/canvas/evas_layer.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/legacy/evas/src/lib/canvas/evas_layer.c b/legacy/evas/src/lib/canvas/evas_layer.c
index 241de45..9f0041d 100644
--- a/legacy/evas/src/lib/canvas/evas_layer.c
+++ b/legacy/evas/src/lib/canvas/evas_layer.c
@@ -1,6 +1,8 @@
1#include "evas_common.h" 1#include "evas_common.h"
2#include "evas_private.h" 2#include "evas_private.h"
3 3
4static void _evas_layer_free(Evas_Layer *lay);
5
4void 6void
5evas_object_inject(Evas_Object *obj, Evas *e) 7evas_object_inject(Evas_Object *obj, Evas *e)
6{ 8{
@@ -31,7 +33,7 @@ evas_object_release(Evas_Object *obj, int clean_layer)
31 if (obj->layer->usage <= 0) 33 if (obj->layer->usage <= 0)
32 { 34 {
33 evas_layer_del(obj->layer); 35 evas_layer_del(obj->layer);
34 evas_layer_free(obj->layer); 36 _evas_layer_free(obj->layer);
35 } 37 }
36 } 38 }
37 obj->layer = NULL; 39 obj->layer = NULL;
@@ -49,6 +51,12 @@ evas_layer_new(Evas *e)
49 return lay; 51 return lay;
50} 52}
51 53
54static void
55_evas_layer_free(Evas_Layer *lay)
56{
57 free(lay);
58}
59
52void 60void
53evas_layer_pre_free(Evas_Layer *lay) 61evas_layer_pre_free(Evas_Layer *lay)
54{ 62{
@@ -62,7 +70,7 @@ evas_layer_pre_free(Evas_Layer *lay)
62} 70}
63 71
64void 72void
65evas_layer_free(Evas_Layer *lay) 73evas_layer_free_objects(Evas_Layer *lay)
66{ 74{
67 while (lay->objects) 75 while (lay->objects)
68 { 76 {
@@ -82,7 +90,7 @@ evas_layer_clean(Evas *e)
82 { 90 {
83 tmp = e->layers; 91 tmp = e->layers;
84 evas_layer_del(tmp); 92 evas_layer_del(tmp);
85 free(tmp); 93 _evas_layer_free(tmp);
86 } 94 }
87} 95}
88 96