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 908a735234ed897de5a7c682a58f7b05b917bdcc..53638da9888fe2483657a9f17fe94667b1438986 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