nv50: fix crash in nv50_pre_pipebuffer_map (nv50_screen->cur_ctx)

nv50_pre_pipebuffer_map references screen->cur_ctx which points
to freed memory after the context is destroyed.
This crash is easily triggerable by progs/xdemos/glxcontexts.
This commit is contained in:
Marcin Slusarz 2010-01-20 23:27:07 +01:00 committed by Ben Skeggs
parent 74989972ba
commit 0ef781c1ae
1 changed files with 4 additions and 0 deletions

View File

@ -86,6 +86,10 @@ nv50_destroy(struct pipe_context *pipe)
so_ref(NULL, &nv50->state.vtxattr);
draw_destroy(nv50->draw);
if (nv50->screen->cur_ctx == nv50)
nv50->screen->cur_ctx = NULL;
FREE(nv50);
}