From: Ben Skeggs Date: Sun, 2 Mar 2008 05:35:47 +0000 (+1100) Subject: nouveau: fix potential crash X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=578b5cd9a030189bcba5c3e86080e1e26eb6e108;p=mesa.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 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);