freedreno: fix crash if ctx torn down with no rendering

In this case, ctx->flush_queue would not have been initialized.

Fixes: 0b613c20 ("freedreno: enable draw/batch reordering by default")
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
Rob Clark 2017-04-15 12:32:17 -04:00
parent 15fe9b2347
commit d4601b0efc

View file

@ -112,7 +112,7 @@ fd_context_destroy(struct pipe_context *pctx)
DBG("");
if (ctx->screen->reorder)
if (ctx->screen->reorder && util_queue_is_initialized(&ctx->flush_queue))
util_queue_destroy(&ctx->flush_queue);
fd_batch_reference(&ctx->batch, NULL); /* unref current batch */