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 81c3fa24ab0637c1ccd6f45f7474321d62e96d4d..2052f914258230b71c48a91e8c9c835d9f3b8163 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 cce2a48533f18ac46b37828ef740a36b9aa837e3..1bd54342e810f14a5cb9f58732986c194704abd3 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);
 }