From fd65fb5aa8cceee151965c383283b038b78562cb Mon Sep 17 00:00:00 2001 From: Andreas Pokorny Date: Sat, 15 Dec 2012 23:28:57 +0100 Subject: [PATCH] vega: fix for object handle leak frees the object handle when a OpenVG is destroyed. Signed-off-by: Andreas Pokorny Signed-off-by: Brian Paul --- src/gallium/state_trackers/vega/mask.c | 1 + src/gallium/state_trackers/vega/paint.c | 4 +++- src/gallium/state_trackers/vega/path.c | 2 ++ src/gallium/state_trackers/vega/text.c | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/vega/mask.c b/src/gallium/state_trackers/vega/mask.c index e46bbdd768a..ca8edd01686 100644 --- a/src/gallium/state_trackers/vega/mask.c +++ b/src/gallium/state_trackers/vega/mask.c @@ -376,6 +376,7 @@ void mask_layer_destroy(struct vg_mask_layer *layer) vg_context_remove_object(ctx, &layer->base); pipe_sampler_view_reference(&layer->sampler_view, NULL); + vg_free_object(&layer->base); FREE(layer); } diff --git a/src/gallium/state_trackers/vega/paint.c b/src/gallium/state_trackers/vega/paint.c index f73e60c9e6d..79b7a277851 100644 --- a/src/gallium/state_trackers/vega/paint.c +++ b/src/gallium/state_trackers/vega/paint.c @@ -229,8 +229,10 @@ void paint_destroy(struct vg_paint *paint) pipe_sampler_view_reference(&paint->gradient.sampler_view, NULL); if (paint->pattern.sampler_view) pipe_sampler_view_reference(&paint->pattern.sampler_view, NULL); - if (ctx) + if (ctx) { vg_context_remove_object(ctx, &paint->base); + vg_free_object(&paint->base); + } free(paint->gradient.ramp_stopsi); free(paint->gradient.ramp_stops); diff --git a/src/gallium/state_trackers/vega/path.c b/src/gallium/state_trackers/vega/path.c index 31ec7199062..a9c18435de5 100644 --- a/src/gallium/state_trackers/vega/path.c +++ b/src/gallium/state_trackers/vega/path.c @@ -234,6 +234,8 @@ void path_destroy(struct path *p) if (p->stroked.path) path_destroy(p->stroked.path); + vg_free_object(&p->base); + FREE(p); } diff --git a/src/gallium/state_trackers/vega/text.c b/src/gallium/state_trackers/vega/text.c index 14e3cc57551..3537f3fb8ac 100644 --- a/src/gallium/state_trackers/vega/text.c +++ b/src/gallium/state_trackers/vega/text.c @@ -157,6 +157,8 @@ void font_destroy(struct vg_font *font) } cso_hash_delete(font->glyphs); + vg_free_object(&font->base); + FREE(font); } -- 2.30.2