dri2: check if context is valid before flushing the pipe
authorCooper Yuan <cooperyuan@gmail.com>
Tue, 16 Aug 2011 12:37:13 +0000 (20:37 +0800)
committerCooper Yuan <cooperyuan@gmail.com>
Tue, 16 Aug 2011 12:37:13 +0000 (20:37 +0800)
src/gallium/state_trackers/dri/drm/dri2.c

index 908a735..53638da 100644 (file)
@@ -49,7 +49,8 @@ dri2_flush_drawable(__DRIdrawable *draw)
    struct dri_drawable *drawable = dri_drawable(draw);
    struct dri_context *ctx = dri_get_current(draw->driScreenPriv);
 
-   ctx->st->flush(ctx->st, 0, NULL);
+   if (ctx)
+      ctx->st->flush(ctx->st, 0, NULL);
 }
 
 static void