python: Don't try to finish a null fence.
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 8 Apr 2009 20:11:51 +0000 (21:11 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Wed, 8 Apr 2009 20:41:04 +0000 (21:41 +0100)
src/gallium/state_trackers/python/p_context.i

index 9a3003a56c424e3c98a077cb9be7313615d80b77..a40aa1e518772fdc6b5ac278f473d6a8ee6d327d 100644 (file)
@@ -258,9 +258,11 @@ error1:
    flush(unsigned flags = 0) {
       struct pipe_fence_handle *fence = NULL; 
       $self->pipe->flush($self->pipe, flags | PIPE_FLUSH_RENDER_CACHE, &fence);
-      /* TODO: allow asynchronous operation */ 
-      $self->pipe->screen->fence_finish( $self->pipe->screen, fence, 0 );
-      $self->pipe->screen->fence_reference( $self->pipe->screen, &fence, NULL );
+      if(fence) {
+         /* TODO: allow asynchronous operation */ 
+         $self->pipe->screen->fence_finish( $self->pipe->screen, fence, 0 );
+         $self->pipe->screen->fence_reference( $self->pipe->screen, &fence, NULL );
+      }
    }
 
    /*