summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-03-02 16:35:47 +1100
committerBen Skeggs <skeggsb@gmail.com>2008-03-02 16:35:47 +1100
commit578b5cd9a030189bcba5c3e86080e1e26eb6e108 (patch)
treee28b8acbcad926bc2fa48fe2e05bf23417520dfb
parenta414173105a18a0c6ed3b03ef986eb6eb30f7a58 (diff)
nouveau: fix potential crash
-rw-r--r--src/gallium/winsys/dri/nouveau/nouveau_context.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/winsys/dri/nouveau/nouveau_context.c b/src/gallium/winsys/dri/nouveau/nouveau_context.c
index dc852c9f498..2e54729aa97 100644
--- a/src/gallium/winsys/dri/nouveau/nouveau_context.c
+++ b/src/gallium/winsys/dri/nouveau/nouveau_context.c
@@ -256,8 +256,10 @@ nouveau_context_destroy(__DRIcontextPrivate *driContextPriv)
if (nv->pctx_id >= 0) {
nvc->pctx[nv->pctx_id] = NULL;
- if (--nvc->refcount <= 0)
+ if (--nvc->refcount <= 0) {
nouveau_channel_context_destroy(nvc);
+ nv->nv_screen->nvc = NULL;
+ }
}
free(nv);