From: Ben Skeggs Date: Sun, 2 Mar 2008 05:35:47 +0000 (+1100) Subject: nouveau: fix potential crash X-Git-Tag: 062012170305~17580^2~496^2~298^2~16^2~349 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=578b5cd9a030189bcba5c3e86080e1e26eb6e108;p=profile%2Fivi%2Fmesa.git nouveau: fix potential crash --- diff --git a/src/gallium/winsys/dri/nouveau/nouveau_context.c b/src/gallium/winsys/dri/nouveau/nouveau_context.c index dc852c9..2e54729 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);