nvc0: fix blitctx memory leak
authorJoakim Sindholt <opensource@zhasha.com>
Sun, 12 May 2013 14:17:00 +0000 (16:17 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Sun, 1 Sep 2013 18:56:23 +0000 (20:56 +0200)
Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
src/gallium/drivers/nvc0/nvc0_context.c
src/gallium/drivers/nvc0/nvc0_context.h
src/gallium/drivers/nvc0/nvc0_surface.c

index bf0c204e197397f3a82e8407899f94aac7e3b87e..f7cfe59dc6b22393c1c5a9f102be55342530703c 100644 (file)
@@ -111,6 +111,7 @@ nvc0_destroy(struct pipe_context *pipe)
    nouveau_pushbuf_kick(nvc0->base.pushbuf, nvc0->base.pushbuf->channel);
 
    nvc0_context_unreference_resources(nvc0);
+   nvc0_blitctx_destroy(nvc0);
 
 #ifdef NVC0_WITH_DRAW_MODULE
    draw_destroy(nvc0->draw);
index 2c84cdf44c6cc0de71604a22661c060093c88075..a175f0acc9a85670fb17d43833f2e93ce1328bfd 100644 (file)
@@ -96,6 +96,7 @@
 struct nvc0_blitctx;
 
 boolean nvc0_blitctx_create(struct nvc0_context *);
+void nvc0_blitctx_destroy(struct nvc0_context *);
 
 struct nvc0_context {
    struct nouveau_context base;
index c8d26f5a12462dfd86365a02cfaed9a07384c220..606a2b577ff22fdabf3abdec8853b64aef106475 100644 (file)
@@ -1246,6 +1246,13 @@ nvc0_blitctx_create(struct nvc0_context *nvc0)
    return TRUE;
 }
 
+void
+nvc0_blitctx_destroy(struct nvc0_context *nvc0)
+{
+   if (nvc0->blit)
+      FREE(nvc0->blit);
+}
+
 void
 nvc0_init_surface_functions(struct nvc0_context *nvc0)
 {