forked from enlightenment/efl
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
This commit is contained in:
parent
e2cd8eea55
commit
01633207ca
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
#include "ector_private.h"
|
#include "ector_private.h"
|
||||||
|
|
||||||
|
#define MY_CLASS ECTOR_RENDERER_GRADIENT_MIXIN
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ector_renderer_gradient_efl_gfx_gradient_stop_set(Eo *obj EINA_UNUSED,
|
_ector_renderer_gradient_efl_gfx_gradient_stop_set(Eo *obj EINA_UNUSED,
|
||||||
Ector_Renderer_Gradient_Data *pd,
|
Ector_Renderer_Gradient_Data *pd,
|
||||||
|
@ -49,5 +51,11 @@ _ector_renderer_gradient_efl_gfx_gradient_spread_get(const Eo *obj EINA_UNUSED,
|
||||||
return pd->s;
|
return pd->s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_ector_renderer_gradient_efl_object_invalidate(Eo *obj EINA_UNUSED,
|
||||||
|
Ector_Renderer_Gradient_Data *pd)
|
||||||
|
{
|
||||||
|
if (pd->colors) free(pd->colors);
|
||||||
|
}
|
||||||
|
|
||||||
#include "ector_renderer_gradient.eo.c"
|
#include "ector_renderer_gradient.eo.c"
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
mixin Ector.Renderer.Gradient (Efl.Gfx.Gradient)
|
mixin Ector.Renderer.Gradient (Efl.Gfx.Gradient, Efl.Object)
|
||||||
{
|
{
|
||||||
[[Ector gradient renderer mixin]]
|
[[Ector gradient renderer mixin]]
|
||||||
eo_prefix: ector_renderer_gradient;
|
eo_prefix: ector_renderer_gradient;
|
||||||
implements {
|
implements {
|
||||||
Efl.Gfx.Gradient.stop { get; set; }
|
Efl.Gfx.Gradient.stop { get; set; }
|
||||||
Efl.Gfx.Gradient.spread { get; set; }
|
Efl.Gfx.Gradient.spread { get; set; }
|
||||||
|
Efl.Object.invalidate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
#include "ector_private.h"
|
#include "ector_private.h"
|
||||||
|
|
||||||
|
#define MY_CLASS ECTOR_RENDERER_SHAPE_MIXIN
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ector_renderer_shape_fill_set(Eo *obj EINA_UNUSED,
|
_ector_renderer_shape_fill_set(Eo *obj EINA_UNUSED,
|
||||||
Ector_Renderer_Shape_Data *pd,
|
Ector_Renderer_Shape_Data *pd,
|
||||||
|
@ -52,4 +54,14 @@ _ector_renderer_shape_stroke_marker_get(const Eo *obj EINA_UNUSED,
|
||||||
return pd->stroke.marker;
|
return pd->stroke.marker;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_ector_renderer_shape_efl_object_invalidate(Eo *obj EINA_UNUSED,
|
||||||
|
Ector_Renderer_Shape_Data *pd)
|
||||||
|
{
|
||||||
|
if (pd->fill) efl_unref(pd->fill);
|
||||||
|
if (pd->stroke.fill) efl_unref(pd->stroke.fill);
|
||||||
|
if (pd->stroke.marker) efl_unref(pd->stroke.marker);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#include "ector_renderer_shape.eo.c"
|
#include "ector_renderer_shape.eo.c"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import ector_renderer;
|
import ector_renderer;
|
||||||
|
|
||||||
mixin Ector.Renderer.Shape (Efl.Gfx.Shape)
|
mixin Ector.Renderer.Shape (Efl.Gfx.Shape, Efl.Object)
|
||||||
{
|
{
|
||||||
[[Ector shape renderer mixin]]
|
[[Ector shape renderer mixin]]
|
||||||
eo_prefix: ector_renderer_shape;
|
eo_prefix: ector_renderer_shape;
|
||||||
|
@ -36,4 +36,7 @@ mixin Ector.Renderer.Shape (Efl.Gfx.Shape)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
implements {
|
||||||
|
Efl.Object.invalidate;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,8 +137,12 @@ _efl_canvas_vg_shape_efl_object_constructor(Eo *obj, Efl_Canvas_Vg_Shape_Data *p
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_efl_canvas_vg_shape_efl_object_destructor(Eo *obj, Efl_Canvas_Vg_Shape_Data *pd EINA_UNUSED)
|
_efl_canvas_vg_shape_efl_object_destructor(Eo *obj, Efl_Canvas_Vg_Shape_Data *pd)
|
||||||
{
|
{
|
||||||
|
if (pd->fill) efl_unref(pd->fill);
|
||||||
|
if (pd->stroke.fill) efl_unref(pd->stroke.fill);
|
||||||
|
if (pd->stroke.marker) efl_unref(pd->stroke.marker);
|
||||||
|
|
||||||
efl_gfx_path_reset(obj);
|
efl_gfx_path_reset(obj);
|
||||||
efl_destructor(efl_super(obj, MY_CLASS));
|
efl_destructor(efl_super(obj, MY_CLASS));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue