summaryrefslogtreecommitdiff
path: root/src/lib/ector
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2018-11-14 21:51:24 +0900
committerHermet Park <hermetpark@gmail.com>2018-11-14 21:51:24 +0900
commit01633207cabcafdaf078e7264c70c2c49f04be7a (patch)
tree2dedecc25a16bcd5bf2a67fd7e0b116b65ed376b /src/lib/ector
parente2cd8eea55c339d1ab96524113f5452a414957d5 (diff)
evas ector: fix memory leaks.
Summary: Make it sure ref/unref pairs. unpaired reference count occures object dangled. @fix Reviewers: #committers Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7270
Diffstat (limited to 'src/lib/ector')
-rw-r--r--src/lib/ector/ector_renderer_gradient.c8
-rw-r--r--src/lib/ector/ector_renderer_gradient.eo3
-rw-r--r--src/lib/ector/ector_renderer_shape.c12
-rw-r--r--src/lib/ector/ector_renderer_shape.eo47
4 files changed, 47 insertions, 23 deletions
diff --git a/src/lib/ector/ector_renderer_gradient.c b/src/lib/ector/ector_renderer_gradient.c
index a3e393a7d3..8ba3ba3fec 100644
--- a/src/lib/ector/ector_renderer_gradient.c
+++ b/src/lib/ector/ector_renderer_gradient.c
@@ -7,6 +7,8 @@
7 7
8#include "ector_private.h" 8#include "ector_private.h"
9 9
10#define MY_CLASS ECTOR_RENDERER_GRADIENT_MIXIN
11
10static void 12static void
11_ector_renderer_gradient_efl_gfx_gradient_stop_set(Eo *obj EINA_UNUSED, 13_ector_renderer_gradient_efl_gfx_gradient_stop_set(Eo *obj EINA_UNUSED,
12 Ector_Renderer_Gradient_Data *pd, 14 Ector_Renderer_Gradient_Data *pd,
@@ -49,5 +51,11 @@ _ector_renderer_gradient_efl_gfx_gradient_spread_get(const Eo *obj EINA_UNUSED,
49 return pd->s; 51 return pd->s;
50} 52}
51 53
54static void
55_ector_renderer_gradient_efl_object_invalidate(Eo *obj EINA_UNUSED,
56 Ector_Renderer_Gradient_Data *pd)
57{
58 if (pd->colors) free(pd->colors);
59}
52 60
53#include "ector_renderer_gradient.eo.c" 61#include "ector_renderer_gradient.eo.c"
diff --git a/src/lib/ector/ector_renderer_gradient.eo b/src/lib/ector/ector_renderer_gradient.eo
index 045c005f7f..f19aa83147 100644
--- a/src/lib/ector/ector_renderer_gradient.eo
+++ b/src/lib/ector/ector_renderer_gradient.eo
@@ -1,9 +1,10 @@
1mixin Ector.Renderer.Gradient (Efl.Gfx.Gradient) 1mixin Ector.Renderer.Gradient (Efl.Gfx.Gradient, Efl.Object)
2{ 2{
3 [[Ector gradient renderer mixin]] 3 [[Ector gradient renderer mixin]]
4 eo_prefix: ector_renderer_gradient; 4 eo_prefix: ector_renderer_gradient;
5 implements { 5 implements {
6 Efl.Gfx.Gradient.stop { get; set; } 6 Efl.Gfx.Gradient.stop { get; set; }
7 Efl.Gfx.Gradient.spread { get; set; } 7 Efl.Gfx.Gradient.spread { get; set; }
8 Efl.Object.invalidate;
8 } 9 }
9} 10}
diff --git a/src/lib/ector/ector_renderer_shape.c b/src/lib/ector/ector_renderer_shape.c
index 162add2613..628acb6d61 100644
--- a/src/lib/ector/ector_renderer_shape.c
+++ b/src/lib/ector/ector_renderer_shape.c
@@ -7,6 +7,8 @@
7 7
8#include "ector_private.h" 8#include "ector_private.h"
9 9
10#define MY_CLASS ECTOR_RENDERER_SHAPE_MIXIN
11
10static void 12static void
11_ector_renderer_shape_fill_set(Eo *obj EINA_UNUSED, 13_ector_renderer_shape_fill_set(Eo *obj EINA_UNUSED,
12 Ector_Renderer_Shape_Data *pd, 14 Ector_Renderer_Shape_Data *pd,
@@ -52,4 +54,14 @@ _ector_renderer_shape_stroke_marker_get(const Eo *obj EINA_UNUSED,
52 return pd->stroke.marker; 54 return pd->stroke.marker;
53} 55}
54 56
57static void
58_ector_renderer_shape_efl_object_invalidate(Eo *obj EINA_UNUSED,
59 Ector_Renderer_Shape_Data *pd)
60{
61 if (pd->fill) efl_unref(pd->fill);
62 if (pd->stroke.fill) efl_unref(pd->stroke.fill);
63 if (pd->stroke.marker) efl_unref(pd->stroke.marker);
64}
65
66
55#include "ector_renderer_shape.eo.c" 67#include "ector_renderer_shape.eo.c"
diff --git a/src/lib/ector/ector_renderer_shape.eo b/src/lib/ector/ector_renderer_shape.eo
index 1a1a9ae240..0206b1afcf 100644
--- a/src/lib/ector/ector_renderer_shape.eo
+++ b/src/lib/ector/ector_renderer_shape.eo
@@ -1,39 +1,42 @@
1import ector_renderer; 1import ector_renderer;
2 2
3mixin Ector.Renderer.Shape (Efl.Gfx.Shape) 3mixin Ector.Renderer.Shape (Efl.Gfx.Shape, Efl.Object)
4{ 4{
5 [[Ector shape renderer mixin]] 5 [[Ector shape renderer mixin]]
6 eo_prefix: ector_renderer_shape; 6 eo_prefix: ector_renderer_shape;
7 methods { 7 methods {
8 @property fill { 8 @property fill {
9 [[Fill property]] 9 [[Fill property]]
10 set { 10 set {
11 } 11 }
12 get { 12 get {
13 } 13 }
14 values { 14 values {
15 r: const(Ector.Renderer); [[Ector fill renderer]] 15 r: const(Ector.Renderer); [[Ector fill renderer]]
16 } 16 }
17 } 17 }
18 @property stroke_fill { 18 @property stroke_fill {
19 [[Stroke fill property]] 19 [[Stroke fill property]]
20 set { 20 set {
21 } 21 }
22 get { 22 get {
23 } 23 }
24 values { 24 values {
25 r: const(Ector.Renderer); [[Ector stroke fill renderer]] 25 r: const(Ector.Renderer); [[Ector stroke fill renderer]]
26 } 26 }
27 } 27 }
28 @property stroke_marker { 28 @property stroke_marker {
29 [[Stroke marker property]] 29 [[Stroke marker property]]
30 set { 30 set {
31 } 31 }
32 get { 32 get {
33 } 33 }
34 values { 34 values {
35 r: const(Ector.Renderer); [[Ector stroke marker renderer]] 35 r: const(Ector.Renderer); [[Ector stroke marker renderer]]
36 } 36 }
37 } 37 }
38 } 38 }
39 implements {
40 Efl.Object.invalidate;
41 }
39} 42}