OSDN Git Service

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 bf0c204..f7cfe59 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 2c84cdf..a175f0a 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 c8d26f5..606a2b5 100644 (file)
@@ -1247,6 +1247,13 @@ nvc0_blitctx_create(struct nvc0_context *nvc0)
 }
 
 void
+nvc0_blitctx_destroy(struct nvc0_context *nvc0)
+{
+   if (nvc0->blit)
+      FREE(nvc0->blit);
+}
+
+void
 nvc0_init_surface_functions(struct nvc0_context *nvc0)
 {
    struct pipe_context *pipe = &nvc0->base.pipe;