summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nvc0
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-03-01 17:08:03 +1000
committerBen Skeggs <bskeggs@redhat.com>2011-03-01 17:23:31 +1000
commit28eb7214db3387eb55109273317a308617341a3f (patch)
tree42b9e2a624ef6061f089377ac1705a75ef995cbd /src/gallium/drivers/nvc0
parent1ba8e9510812f155359d380bda6876cdee5ba21e (diff)
nvc0: fix a crash on context destruction
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'src/gallium/drivers/nvc0')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_context.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_context.c b/src/gallium/drivers/nvc0/nvc0_context.c
index d5dcf1fb02..d6de979b13 100644
--- a/src/gallium/drivers/nvc0/nvc0_context.c
+++ b/src/gallium/drivers/nvc0/nvc0_context.c
@@ -62,8 +62,10 @@ nvc0_destroy(struct pipe_context *pipe)
draw_destroy(nvc0->draw);
- if (nvc0->screen->cur_ctx == nvc0)
+ if (nvc0->screen->cur_ctx == nvc0) {
+ nvc0->screen->base.channel->user_private = NULL;
nvc0->screen->cur_ctx = NULL;
+ }
FREE(nvc0);
}
@@ -73,8 +75,10 @@ nvc0_default_flush_notify(struct nouveau_channel *chan)
{
struct nvc0_context *nvc0 = chan->user_private;
- nouveau_fence_update(&nvc0->screen->base, TRUE);
+ if (!nvc0)
+ return;
+ nouveau_fence_update(&nvc0->screen->base, TRUE);
nouveau_fence_next(&nvc0->screen->base);
}