nv30: avoid dangling references to deleted contexts
authorIlia Mirkin <imirkin@alum.mit.edu>
Wed, 18 Jun 2014 02:32:03 +0000 (22:32 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 19 Jun 2014 05:05:52 +0000 (01:05 -0400)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
src/gallium/drivers/nouveau/nv30/nv30_context.c

index f325c5c..617b088 100644 (file)
@@ -165,6 +165,9 @@ nv30_context_destroy(struct pipe_context *pipe)
    if (nv30->draw)
       draw_destroy(nv30->draw);
 
+   if (nv30->screen->base.pushbuf->user_priv == &nv30->bufctx)
+      nv30->screen->base.pushbuf->user_priv = NULL;
+
    nouveau_bufctx_del(&nv30->bufctx);
 
    if (nv30->screen->cur_ctx == nv30)