summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv30/nv30_context.c
diff options
context:
space:
mode:
authorYounes Manton <younes.m@gmail.com>2009-12-28 17:33:34 -0500
committerYounes Manton <younes.m@gmail.com>2009-12-28 17:59:01 -0500
commit85dcc070719ef6a6bcf65dc4996b1733f63912d8 (patch)
tree909e191a4b44987761756c53514cdc950ce4ea14 /src/gallium/drivers/nv30/nv30_context.c
parentcb9214f33030e1f482d59049c239f20061d24ad8 (diff)
nouveau: Unreference state/buffer objects on context/screen destruction.
- unreference state objects so that buffer objects are unreferenced and eventually destroyed - free channel at screen's destruction Based on Krzysztof Smiechowicz's patch.
Diffstat (limited to 'src/gallium/drivers/nv30/nv30_context.c')
-rw-r--r--src/gallium/drivers/nv30/nv30_context.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv30/nv30_context.c b/src/gallium/drivers/nv30/nv30_context.c
index 46a821a48b..38b39159f1 100644
--- a/src/gallium/drivers/nv30/nv30_context.c
+++ b/src/gallium/drivers/nv30/nv30_context.c
@@ -25,6 +25,12 @@ static void
nv30_destroy(struct pipe_context *pipe)
{
struct nv30_context *nv30 = nv30_context(pipe);
+ unsigned i;
+
+ for (i = 0; i < NV30_STATE_MAX; i++) {
+ if (nv30->state.hw[i])
+ so_ref(NULL, &nv30->state.hw[i]);
+ }
if (nv30->draw)
draw_destroy(nv30->draw);