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 f325c5cfc6824496ab5d43872877ccb7d11d7267..617b08878101fd4245ccf93389d84194ad0f326a 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)