From 85dcc070719ef6a6bcf65dc4996b1733f63912d8 Mon Sep 17 00:00:00 2001 From: Younes Manton Date: Mon, 28 Dec 2009 17:33:34 -0500 Subject: 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. --- src/gallium/drivers/nv40/nv40_context.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/gallium/drivers/nv40/nv40_context.c') diff --git a/src/gallium/drivers/nv40/nv40_context.c b/src/gallium/drivers/nv40/nv40_context.c index eb9cce4c78..d56c7a6b49 100644 --- a/src/gallium/drivers/nv40/nv40_context.c +++ b/src/gallium/drivers/nv40/nv40_context.c @@ -25,6 +25,12 @@ static void nv40_destroy(struct pipe_context *pipe) { struct nv40_context *nv40 = nv40_context(pipe); + unsigned i; + + for (i = 0; i < NV40_STATE_MAX; i++) { + if (nv40->state.hw[i]) + so_ref(NULL, &nv40->state.hw[i]); + } if (nv40->draw) draw_destroy(nv40->draw); -- cgit v1.2.3