check for fence==NULL in intel_batchbuffer_finish(), fixes glxinfo crash on exit
authorBrian <brian.paul@tungstengraphics.com>
Thu, 8 Nov 2007 14:58:53 +0000 (07:58 -0700)
committerBrian <brian.paul@tungstengraphics.com>
Thu, 8 Nov 2007 15:48:14 +0000 (08:48 -0700)
src/mesa/drivers/dri/intel_winsys/intel_batchbuffer.c

index 784ed2210acebd38e7a5b43caa0d54b772762a8b..49e04d81ec1ef1315e58d561070628fb534ce69c 100644 (file)
@@ -311,11 +311,13 @@ void
 intel_batchbuffer_finish(struct intel_batchbuffer *batch)
 {
    struct _DriFenceObject *fence = intel_batchbuffer_flush(batch);
-   driFenceReference(fence);
-   driFenceFinish(fence,
-                  DRM_FENCE_TYPE_EXE | DRM_I915_FENCE_TYPE_RW,
-                  GL_FALSE);
-   driFenceUnReference(fence);
+   if (fence) {
+      driFenceReference(fence);
+      driFenceFinish(fence,
+                     DRM_FENCE_TYPE_EXE | DRM_I915_FENCE_TYPE_RW,
+                     GL_FALSE);
+      driFenceUnReference(fence);
+   }
 }