nv50,nvc0: fix stream output target buffer leak
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Thu, 14 Jun 2012 19:48:46 +0000 (21:48 +0200)
committerMarcin Slusarz <marcin.slusarz@gmail.com>
Thu, 14 Jun 2012 21:38:28 +0000 (23:38 +0200)
It manifests at exit as:
"WARNING: destroying GPU memory cache with some buffers still in use"

src/gallium/drivers/nv50/nv50_state.c
src/gallium/drivers/nvc0/nvc0_state.c

index 81c3fa2..2052f91 100644 (file)
@@ -983,6 +983,7 @@ nv50_so_target_destroy(struct pipe_context *pipe,
    struct nv50_so_target *targ = nv50_so_target(ptarg);
    if (targ->pq)
       pipe->destroy_query(pipe, targ->pq);
+   pipe_resource_reference(&targ->pipe.buffer, NULL);
    FREE(targ);
 }
 
index cce2a48..1bd5434 100644 (file)
@@ -899,6 +899,7 @@ nvc0_so_target_destroy(struct pipe_context *pipe,
 {
    struct nvc0_so_target *targ = nvc0_so_target(ptarg);
    pipe->destroy_query(pipe, targ->pq);
+   pipe_resource_reference(&targ->pipe.buffer, NULL);
    FREE(targ);
 }