From: José Fonseca Date: Thu, 6 May 2010 20:33:01 +0000 (+0100) Subject: llvmpipe: Fix fence wait. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=680071502ffe54c96ef9f458a9e1c668bb27fe76;p=mesa.git llvmpipe: Fix fence wait. Avoids crashing when fence is NULL (LP_NUM_THREADS=0) and leaking when it is not. --- diff --git a/src/gallium/drivers/llvmpipe/lp_query.c b/src/gallium/drivers/llvmpipe/lp_query.c index a1836bbde91..c23e9839063 100644 --- a/src/gallium/drivers/llvmpipe/lp_query.c +++ b/src/gallium/drivers/llvmpipe/lp_query.c @@ -106,7 +106,10 @@ llvmpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q) if (pq->binned) { struct pipe_fence_handle *fence; pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, &fence); - pipe->screen->fence_finish(pipe->screen, fence, 0); + if (fence) { + pipe->screen->fence_finish(pipe->screen, fence, 0); + pipe->screen->fence_reference(pipe->screen, &fence, NULL); + } } lp_setup_begin_query(llvmpipe->setup, pq);