vega: fix for object handle leak
authorAndreas Pokorny <andreas.pokorny@elektrobit.com>
Sat, 15 Dec 2012 22:28:57 +0000 (23:28 +0100)
committerBrian Paul <brianp@vmware.com>
Mon, 17 Dec 2012 17:22:26 +0000 (10:22 -0700)
frees the object handle when a OpenVG
is destroyed.

Signed-off-by: Andreas Pokorny <andreas.pokorny@elektrobit.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
src/gallium/state_trackers/vega/mask.c
src/gallium/state_trackers/vega/paint.c
src/gallium/state_trackers/vega/path.c
src/gallium/state_trackers/vega/text.c

index e46bbdd768addb7b5a6a9100320207ba4cf06662..ca8edd016866002201f6edc7377ad11234420ab1 100644 (file)
@@ -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);
 }
 
index f73e60c9e6d7ef68191aff2a2f80c231a221baec..79b7a277851e7e10622cd6cb1f1bef315dc27480 100644 (file)
@@ -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);
index 31ec71990620a013f7a0584fa6065e6f05143115..a9c18435de50c5e305cc3ff6b4ec704f7b87681d 100644 (file)
@@ -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);
 }
 
index 14e3cc575512cebbcce648754a44adcde2e23e79..3537f3fb8acd6d276e572ace38268788e4d3aecd 100644 (file)
@@ -157,6 +157,8 @@ void font_destroy(struct vg_font *font)
    }
    cso_hash_delete(font->glyphs);
 
+   vg_free_object(&font->base);
+
    FREE(font);
 }